In Linux with musl libc, we have this inclusion chain:
compat/regex/regex.c:69
`-> compat/regex/regex_internal.h
`-> /usr/include/stdlib.h
`-> /usr/include/features.h
`-> /usr/include/alloca.h
In that inclusion chain, `<features.h>` claims it's _BSD_SOURCE
compatible when it's NOT asked to be either
{_POSIX,_GNU,_XOPEN,_BSD}_SOURCE, or __STRICT_ANSI__.
And, `<stdlib.h>` will include `<alloca.h>` to be compatible with
software written for GNU and BSD. Thus, redefine `alloca` macro,
which was defined before at compat/regex/regex.c:66.
Considering this is only compat code, we've taken from other project,
it's not our business to decide which source should we adhere to.
Include `<stdlib.h>` early to prevent the redefinition of alloca.
This also remove a potential warning about alloca not defined on:
#undef alloca
Helped-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
|
||
|---|---|---|
| .. | ||
| nedmalloc | ||
| poll | ||
| regex | ||
| vcbuild | ||
| win32 | ||
| access.c | ||
| apple-common-crypto.h | ||
| basename.c | ||
| bswap.h | ||
| fileno.c | ||
| fopen.c | ||
| gmtime.c | ||
| hstrerror.c | ||
| inet_ntop.c | ||
| inet_pton.c | ||
| memmem.c | ||
| mingw.c | ||
| mingw.h | ||
| mkdir.c | ||
| mkdtemp.c | ||
| mmap.c | ||
| msvc.c | ||
| msvc.h | ||
| obstack.c | ||
| obstack.h | ||
| pread.c | ||
| precompose_utf8.c | ||
| precompose_utf8.h | ||
| qsort_s.c | ||
| setenv.c | ||
| sha1-chunked.c | ||
| sha1-chunked.h | ||
| snprintf.c | ||
| stat.c | ||
| strcasestr.c | ||
| strdup.c | ||
| strlcpy.c | ||
| strtoimax.c | ||
| strtoumax.c | ||
| terminal.c | ||
| terminal.h | ||
| unsetenv.c | ||
| win32.h | ||
| win32mmap.c | ||
| winansi.c | ||