about summary refs log tree commit diff
path: root/crt/x32
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2021-02-22 15:52:21 -0500
committerRich Felker <dalias@aerifal.cx>2021-02-22 15:52:21 -0500
commitb129cd8690da492b25b66061e29e52aae235f1e3 (patch)
treeecf69a6448c98f70251a19430d131445ceaf268d /crt/x32
parent3309e2d7a1aa82e52d7ac0facd64f9b5c28f923b (diff)
downloadmusl-b129cd8690da492b25b66061e29e52aae235f1e3.tar.gz
musl-b129cd8690da492b25b66061e29e52aae235f1e3.tar.xz
musl-b129cd8690da492b25b66061e29e52aae235f1e3.zip
guard against compilers failing to handle setjmp specially by default
since 4.1, gcc has had the __returns_twice__ attribute and has
required functions which return twice to carry it; however it's always
applied it automatically to known setjmp-like function names. clang
however does not do this reliably, at least not with -ffreestanding
and possibly under other conditions, resulting in silent emission of
wrong code.

since the symbol name setjmp is in no way special (setjmp is specified
as a macro that could expand to use any implementation-specific symbol
name or names), a compiler is justified not to do anything special
without further hints, and it's reasonable to do what we can to
provide such hints.

gcc 4.0.x and earlier do not recognize the attribute, so make use
conditional on __GNUC__ macros. clang and other gcc-like compilers
report (and have always reported) a later "GNUC" version so the
preprocessor conditional should function as desired for them as too.

undefine the internal macro after use so that nothing abuses it as a
public feature.
Diffstat (limited to 'crt/x32')
0 files changed, 0 insertions, 0 deletions