summaryrefslogtreecommitdiff
path: root/include/stdlib.h
diff options
context:
space:
mode:
authorNatanael Copa2016-07-14 16:45:11 +0200
committersin2016-07-14 16:09:13 +0100
commit9880d5864bfa5ae3fa6ca7b739953ac5f74524be (patch)
treec72bc12d89cde2ef0a9c95d4fcb509fdb0979572 /include/stdlib.h
parent578b693300171edfbbefb4b14f1bc9bd46f94a1f (diff)
Only include limits.h when actually used
The __extension__ seems to trigger a bug in gcc when there are no identifier specified afterwards. Testcase: echo "#include <stdlib.h>" > try.c && cc -O0 -c try.c try.c:2:0: error: expected identifier or '(' at end of input With -O2 it does not happen. We work around this by only pulling in limits.h when we actually need the PATH_MAX. Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Diffstat (limited to 'include/stdlib.h')
-rw-r--r--include/stdlib.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/stdlib.h b/include/stdlib.h
index 26c7e44..0717e81 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -19,12 +19,12 @@
19__extension__ 19__extension__
20#include_next <stdlib.h> 20#include_next <stdlib.h>
21 21
22#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 && defined(__OPTIMIZE__) && __OPTIMIZE__ > 0
22#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) 23#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
23__extension__ 24__extension__
24#include_next <limits.h> 25#include_next <limits.h>
25#endif 26#endif
26 27
27#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 && defined(__OPTIMIZE__) && __OPTIMIZE__ > 0
28#include "fortify-headers.h" 28#include "fortify-headers.h"
29 29
30#ifdef __cplusplus 30#ifdef __cplusplus