samples, tests, boards: Switch main return type from void to int
As both C and C++ standards require applications running under an OS to return 'int', adapt that for Zephyr to align with those standard. This also eliminates errors when building with clang when not using -ffreestanding, and reduces the need for compiler flags to silence warnings for both clang and gcc. Most of these changes were automated using coccinelle with the following script: @@ @@ - void + int main(...) { ... - return; + return 0; ... } Approximately 40 files had to be edited by hand as coccinelle was unable to fix them. Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
parent
fc076f5a1d
commit
0b90fd5adf
447 changed files with 1617 additions and 1231 deletions
|
@ -15,7 +15,8 @@ bst_test_install_t test_installers[] = {
|
|||
NULL
|
||||
};
|
||||
|
||||
void main(void)
|
||||
int main(void)
|
||||
{
|
||||
bst_main();
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -15,7 +15,8 @@ bst_test_install_t test_installers[] = {
|
|||
NULL
|
||||
};
|
||||
|
||||
void main(void)
|
||||
int main(void)
|
||||
{
|
||||
bst_main();
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -15,7 +15,8 @@ bst_test_install_t test_installers[] = {
|
|||
NULL
|
||||
};
|
||||
|
||||
void main(void)
|
||||
int main(void)
|
||||
{
|
||||
bst_main();
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -15,7 +15,8 @@ bst_test_install_t test_installers[] = {
|
|||
NULL
|
||||
};
|
||||
|
||||
void main(void)
|
||||
int main(void)
|
||||
{
|
||||
bst_main();
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -125,7 +125,8 @@ bst_test_install_t test_installers[] = {
|
|||
NULL
|
||||
};
|
||||
|
||||
void main(void)
|
||||
int main(void)
|
||||
{
|
||||
bst_main();
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue