Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / libraries / fortify-headers / wchar-imports-skip.patch
blob255ceba9f099b265828f2c5de39e5b6943728319
1 wchar.h: only include other headers if _FORTIFY_SOURCE is enabled
3 unexpectedly including other headers can cause problems with
4 sensitive/brittle code, particularly with alternative compilers
5 (clang) which are already operating on the margins of what's
6 supported/expected by some projects.
8 having a way to almost entirely short-circuit these headers (by
9 disabling _FORTIFY_SOURCE) is therefore important.
11 --- a/include/fortify/wchar.h
12 +++ b/include/fortify/wchar.h
13 @@ -20,21 +20,23 @@
14 #if !defined(__cplusplus) && !defined(__clang__)
15 __extension__
16 #endif
17 -#include_next <limits.h>
18 +#include_next <wchar.h>
20 +#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 && defined(__OPTIMIZE__) && __OPTIMIZE__ > 0
22 #if !defined(__cplusplus) && !defined(__clang__)
23 __extension__
24 #endif
25 -#include_next <stdlib.h>
26 +#include_next <limits.h>
27 #if !defined(__cplusplus) && !defined(__clang__)
28 __extension__
29 #endif
30 -#include_next <string.h>
31 +#include_next <stdlib.h>
32 #if !defined(__cplusplus) && !defined(__clang__)
33 __extension__
34 #endif
35 -#include_next <wchar.h>
36 +#include_next <string.h>
38 -#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 && defined(__OPTIMIZE__) && __OPTIMIZE__ > 0
39 #include "fortify-headers.h"
41 #ifdef __cplusplus