From 9880d5864bfa5ae3fa6ca7b739953ac5f74524be Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Thu, 14 Jul 2016 16:45:11 +0200 Subject: [PATCH] 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 " > 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 --- include/stdlib.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 @@ __extension__ #include_next +#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 && defined(__OPTIMIZE__) && __OPTIMIZE__ > 0 #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) __extension__ #include_next #endif -#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 && defined(__OPTIMIZE__) && __OPTIMIZE__ > 0 #include "fortify-headers.h" #ifdef __cplusplus