4 ms·
I figured it out (without actually building with Musl). Musl's <stdlib.h> includes <alloca.h> already if _GNU_SOURCE or _BSD_SOURCE is defined. Musl's <alloca
by kazinator 8y ago
I figured it out (without actually building with Musl).
Musl's <stdlib.h> includes <alloca.h> already if _GNU_SOURCE or _BSD_SOURCE is defined.
Musl's <alloca.h> defines an object-like alloca macro if compiled with GCC: #define alloca __builtin_alloca.
When we try to include the <alloca.h> header through a macro, as in #include ALLOCA_H, it's subject to macro expansion: ALLOCA_H is replaced with <alloca.h>. This is five pp-tokens: < alloca . h >. The second one is the macro that was defined due to <stdlib.h> having included <alloca.h> already, and so this gets replaced now; we end up with #include <__builtin_alloca.h>.