sandbox: fix compiler warning
PATCH v3 1/1 sandbox: fix compiler warning
Add back return statement to fix compiler warning about control flow reaching end of non void function that was introduced with:
e05e5de arm: move C runtime setup code in crt0.S
--- arch/sandbox/cpu/start.c | 3 +++ 1 file changed, 3 insertions(+)
arch/sandbox/cpu/start.c +3 -0
@@ -122,4 +122,7 @@ int main(int argc, char *argv[])* never return. */ board_init_f (0 ); + +/* NOTREACHED - board_init_f() does not return */ +return 0 ; }
Signature · 1 line
1.7.10.4
PATCH v3 1/1 sandbox: fix compiler warning
Hi Allen,
Quoted 16 lines · Allen Martin
Add back return statement to fix compiler warning about control flow reaching end of non void function that was introduced with:
e05e5de arm: move C runtime setup code in
crt0.SSigned-off-by Allen Martin <[email protected]>Acked-by Simon Glass <[email protected]>--- arch/sandbox/cpu/start.c | 3 +++ 1 file changed, 3 insertions(+)arch/sandbox/cpu/start.c +0
-0
arch/sandbox/cpu/start.c int main(int argc, char *argv[]) · line 128
Quoted 7 lines
arch/sandbox/cpu/start.c +3
-0@@ -122,4 +122,7 @@ int main(int argc, char *argv[])* never return. */ board_init_f (0 ); + +/* NOTREACHED - board_init_f() does not return */ +return 0 ; }
Shouldn't the function be given '__attribute__((noreturn))' rather than adding a non-executed 'return 0' to it?
Amicalement,
Signature · 1 line
Albert.
PATCH v3 1/1 sandbox: fix compiler warning
Quoted 16 lines · Albert ARIBAUD
Hi Allen,
Quoted 11 lines · Allen Martin
Add back return statement to fix compiler warning about control flow reaching end of non void function that was introduced with:
e05e5de arm: move C runtime setup code in
crt0.SSigned-off-by Allen Martin <[email protected]>Acked-by Simon Glass <[email protected]>--- arch/sandbox/cpu/start.c | 3 +++ 1 file changed, 3 insertions(+)
Quoted 16 lines
arch/sandbox/cpu/start.c int main(int argc, char *argv[]) · line 128
Quoted 12 lines
arch/sandbox/cpu/start.c +3
-0@@ -122,4 +122,7 @@ int main(int argc, char *argv[])* never return. */ board_init_f (0 ); + +/* NOTREACHED - board_init_f() does not return */ +return 0 ; }Shouldn't the function be given '__attribute__((noreturn))' rather than adding a non-executed 'return 0' to it?
The function in question is sandbox main(), and it can return if there was an error prior to calling board_init_f(). Here's the whole function for context:
int main(int argc, char *argv[])
{
struct sandbox_state *state;
int err;
err = state_init();
if (err)
return err;
state = state_get_current();
if (os_parse_args(state, argc, argv))
return 1;
/*
* Do pre- and post-relocation init, then start up
U-Boot. This will
* never return.
*/
board_init_f(0);
/* NOTREACHED - board_init_f() does not return */
return 0;
}-Allen
Signature · 1 line
nvpublic
PATCH v3 1/1 sandbox: fix compiler warning
Hi Allen,
Quoted 9 lines · Allen Martin
Quoted 3 lines
Shouldn't the function be given '__attribute__((noreturn))' rather than adding a non-executed 'return 0' to it?
The function in question is sandbox
main(), and it can return if there was an error prior to callingboard_init_f(). Here's the whole function for context:int
main(int argc, char *argv[])[...]
Makes sense, thanks.
Quoted 1 line
-Allen
Amicalement,
Signature · 1 line
Albert.
Simon Glass
AppliedPATCH v3 1/1 sandbox: fix compiler warning
Quoted 15 lines · Albert ARIBAUD
Hi Allen,
Quoted 9 lines · Allen Martin
Quoted 3 lines
Shouldn't the function be given '__attribute__((noreturn))' rather than adding a non-executed 'return 0' to it?
The function in question is sandbox
main(), and it can return if there was an error prior to callingboard_init_f(). Here's the whole function for context:int
main(int argc, char *argv[])[...]
Quoted 7 lines
Makes sense, thanks.
Quoted 1 line
-Allen
Amicalement,
--
Albert.
Applied to x86/master.