fortify-headers: fix compatibility with -pedantic
[openwrt/openwrt.git] / toolchain / fortify-headers / patches / 101-fix-pedantic.patch
1 From 631ada7ea21c9a8f389ce0448ae05e0881264fec Mon Sep 17 00:00:00 2001
2 From: Steven Barth <steven@midlink.org>
3 Date: Wed, 24 Jun 2015 20:13:37 +0200
4 Subject: [PATCH] Add __extension__ mark to include_next to silence -pedantic
5
6 Signed-off-by: Steven Barth <steven@midlink.org>
7 ---
8 include/poll.h | 1 +
9 include/stdio.h | 1 +
10 include/stdlib.h | 2 ++
11 include/string.h | 1 +
12 include/sys/select.h | 1 +
13 include/sys/socket.h | 1 +
14 include/unistd.h | 1 +
15 include/wchar.h | 2 ++
16 8 files changed, 10 insertions(+)
17
18 diff --git a/include/poll.h b/include/poll.h
19 index d9b602c..9e1d99a 100644
20 --- a/include/poll.h
21 +++ b/include/poll.h
22 @@ -16,6 +16,7 @@
23 #ifndef _FORTIFY_POLL_H
24 #define _FORTIFY_POLL_H
25
26 +__extension__
27 #include_next <poll.h>
28
29 #if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 && defined(__OPTIMIZE__) && __OPTIMIZE__ > 0
30 diff --git a/include/stdio.h b/include/stdio.h
31 index 996c661..1b76f82 100644
32 --- a/include/stdio.h
33 +++ b/include/stdio.h
34 @@ -16,6 +16,7 @@
35 #ifndef _FORTIFY_STDIO_H
36 #define _FORTIFY_STDIO_H
37
38 +__extension__
39 #include_next <stdio.h>
40
41 #if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 && defined(__OPTIMIZE__) && __OPTIMIZE__ > 0
42 diff --git a/include/stdlib.h b/include/stdlib.h
43 index 2b67235..f89341f 100644
44 --- a/include/stdlib.h
45 +++ b/include/stdlib.h
46 @@ -16,9 +16,11 @@
47 #ifndef _FORTIFY_STDLIB_H
48 #define _FORTIFY_STDLIB_H
49
50 +__extension__
51 #include_next <stdlib.h>
52
53 #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
54 +__extension__
55 #include_next <limits.h>
56 #endif
57
58 diff --git a/include/string.h b/include/string.h
59 index 98bfea1..a4072d6 100644
60 --- a/include/string.h
61 +++ b/include/string.h
62 @@ -16,6 +16,7 @@
63 #ifndef _FORTIFY_STRING_H
64 #define _FORTIFY_STRING_H
65
66 +__extension__
67 #include_next <string.h>
68
69 #if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 && defined(__OPTIMIZE__) && __OPTIMIZE__ > 0
70 diff --git a/include/sys/select.h b/include/sys/select.h
71 index db6135d..7f768f4 100644
72 --- a/include/sys/select.h
73 +++ b/include/sys/select.h
74 @@ -16,6 +16,7 @@
75 #ifndef _FORTIFY_SYS_SELECT_H
76 #define _FORTIFY_SYS_SELECT_H
77
78 +__extension__
79 #include_next <sys/select.h>
80
81 #if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 && defined(__OPTIMIZE__) && __OPTIMIZE__ > 0
82 diff --git a/include/sys/socket.h b/include/sys/socket.h
83 index e68e21c..9454951 100644
84 --- a/include/sys/socket.h
85 +++ b/include/sys/socket.h
86 @@ -16,6 +16,7 @@
87 #ifndef _FORTIFY_SYS_SOCKET_H
88 #define _FORTIFY_SYS_SOCKET_H
89
90 +__extension__
91 #include_next <sys/socket.h>
92
93 #if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 && defined(__OPTIMIZE__) && __OPTIMIZE__ > 0
94 diff --git a/include/unistd.h b/include/unistd.h
95 index 5274e22..5fa3b44 100644
96 --- a/include/unistd.h
97 +++ b/include/unistd.h
98 @@ -16,6 +16,7 @@
99 #ifndef _FORTIFY_UNISTD_H
100 #define _FORTIFY_UNISTD_H
101
102 +__extension__
103 #include_next <unistd.h>
104
105 #if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 && defined(__OPTIMIZE__) && __OPTIMIZE__ > 0
106 diff --git a/include/wchar.h b/include/wchar.h
107 index 6fa86f2..0d4abfa 100644
108 --- a/include/wchar.h
109 +++ b/include/wchar.h
110 @@ -16,7 +16,9 @@
111 #ifndef _FORTIFY_WCHAR_H
112 #define _FORTIFY_WCHAR_H
113
114 +__extension__
115 #include_next <stdlib.h>
116 +__extension__
117 #include_next <wchar.h>
118
119 #if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 && defined(__OPTIMIZE__) && __OPTIMIZE__ > 0
120 --
121 2.1.4
122