]> granicus.if.org Git - musl/commitdiff
remove useless infinite loop from end of exit function
authorRich Felker <dalias@aerifal.cx>
Fri, 18 Jul 2014 01:37:10 +0000 (21:37 -0400)
committerRich Felker <dalias@aerifal.cx>
Fri, 18 Jul 2014 01:37:10 +0000 (21:37 -0400)
this was originally added as a cheap but portable way to quell
warnings about reaching the end of a function that does not return,
but since _Exit is marked _Noreturn, it's not needed. removing it
makes the call to _Exit into a tail call and shaves off a few bytes of
code from minimal static programs.

src/exit/exit.c

index 27fb3e292d756e13d73466ed87607da4d5933f5e..163d8f1b22a996d55230bcbf86d5c2890404684c 100644 (file)
@@ -31,5 +31,4 @@ _Noreturn void exit(int code)
        __stdio_exit();
 
        _Exit(code);
-       for(;;);
 }