mirror of
https://git.musl-libc.org/git/musl
synced 2025-02-19 03:34:17 +03:00

after commit a48ccc159a5fa061a18419296100ee48a1cd6cc9 removed the use of _Noreturn on the stage3_func type (which only worked due to it being defined to the "GNU C" attribute in C99 mode), GCC could no longer assume that the ends of __dls2 and __dls2b are unreachable, and produced a warning that a function marked _Noreturn returns. also, since commit 4390383b32250a941ec616e8bff6f568a801b1c0, the _Noreturn declaration for __libc_start_main in crt1/rcrt1 has been not only inconsistent with the definition, but wrong. formally, __libc_start_main does return, via a (hopefully) tail call to a helper function after the barrier. incorrect usage of _Noreturn in the declaration was probably formal UB. the _Noreturn specifiers were not useful in any of these places, so remove them all. now, the only remaining usage of _Noreturn is in public interfaces where _Noreturn is part of their contract.
20 lines
352 B
C
20 lines
352 B
C
#include <features.h>
|
|
#include "libc.h"
|
|
|
|
#define START "_start"
|
|
|
|
#include "crt_arch.h"
|
|
|
|
int main();
|
|
weak void _init();
|
|
weak void _fini();
|
|
int __libc_start_main(int (*)(), int, char **,
|
|
void (*)(), void(*)(), void(*)());
|
|
|
|
void _start_c(long *p)
|
|
{
|
|
int argc = p[0];
|
|
char **argv = (void *)(p+1);
|
|
__libc_start_main(main, argc, argv, _init, _fini, 0);
|
|
}
|