summaryrefslogtreecommitdiff
path: root/include/wchar.h
diff options
context:
space:
mode:
authorjvoisin2023-09-21 15:50:32 +0200
committerjvoisin2023-09-21 15:50:32 +0200
commit8c2352b985b1bf69efb965ba15f5e300eb7e8e12 (patch)
tree9901e915156ca32c0b9f006f3139ba34958f68ef /include/wchar.h
parent46add4c4aecbbb8edb4b70ac5ed3a8c144f497ee (diff)
Properly enable diagnose_as_builtin attribute
Diffstat (limited to 'include/wchar.h')
-rw-r--r--include/wchar.h16
1 files changed, 0 insertions, 16 deletions
diff --git a/include/wchar.h b/include/wchar.h
index 4ca49e8..dc73fab 100644
--- a/include/wchar.h
+++ b/include/wchar.h
@@ -56,7 +56,6 @@ extern "C" {
56#undef wmemmove 56#undef wmemmove
57#undef wmemset 57#undef wmemset
58 58
59__diagnose_as_builtin(__builtin_fgetws, 1, 2, 3)
60_FORTIFY_FN(fgetws) wchar_t *fgetws(wchar_t * _FORTIFY_POS0 __s, 59_FORTIFY_FN(fgetws) wchar_t *fgetws(wchar_t * _FORTIFY_POS0 __s,
61 int __n, FILE *__f) 60 int __n, FILE *__f)
62{ 61{
@@ -70,7 +69,6 @@ _FORTIFY_FN(fgetws) wchar_t *fgetws(wchar_t * _FORTIFY_POS0 __s,
70#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ 69#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
71 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) 70 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
72#undef mbsnrtowcs 71#undef mbsnrtowcs
73__diagnose_as_builtin(__builtin_mbsnrtowcs, 1, 2, 3, 4, 5)
74_FORTIFY_FN(mbsnrtowcs) size_t mbsnrtowcs(wchar_t * _FORTIFY_POS0 __d, 72_FORTIFY_FN(mbsnrtowcs) size_t mbsnrtowcs(wchar_t * _FORTIFY_POS0 __d,
75 const char **__s, size_t __n, 73 const char **__s, size_t __n,
76 size_t __wn, mbstate_t *__st) 74 size_t __wn, mbstate_t *__st)
@@ -92,7 +90,6 @@ _FORTIFY_FN(mbsnrtowcs) size_t mbsnrtowcs(wchar_t * _FORTIFY_POS0 __d,
92} 90}
93#endif 91#endif
94 92
95__diagnose_as_builtin(__builtin_mbsrtowcs, 1, 2, 3, 4)
96_FORTIFY_FN(mbsrtowcs) size_t mbsrtowcs(wchar_t * _FORTIFY_POS0 __d, 93_FORTIFY_FN(mbsrtowcs) size_t mbsrtowcs(wchar_t * _FORTIFY_POS0 __d,
97 const char **__s, size_t __wn, 94 const char **__s, size_t __wn,
98 mbstate_t *__st) 95 mbstate_t *__st)
@@ -107,7 +104,6 @@ _FORTIFY_FN(mbsrtowcs) size_t mbsrtowcs(wchar_t * _FORTIFY_POS0 __d,
107 return __r; 104 return __r;
108} 105}
109 106
110__diagnose_as_builtin(__builtin_mbstowcs, 1, 2, 3)
111_FORTIFY_FN(mbstowcs) size_t mbstowcs(wchar_t * _FORTIFY_POS0 __ws, 107_FORTIFY_FN(mbstowcs) size_t mbstowcs(wchar_t * _FORTIFY_POS0 __ws,
112 const char *__s, size_t __wn) 108 const char *__s, size_t __wn)
113{ 109{
@@ -120,7 +116,6 @@ _FORTIFY_FN(mbstowcs) size_t mbstowcs(wchar_t * _FORTIFY_POS0 __ws,
120 116
121/* FIXME clang */ 117/* FIXME clang */
122#ifndef __clang__ 118#ifndef __clang__
123__diagnose_as_builtin(__builtin_wcrtomb, 1, 2, 3)
124_FORTIFY_FN(wcrtomb) size_t wcrtomb(char * __s, wchar_t __w, mbstate_t *__st) 119_FORTIFY_FN(wcrtomb) size_t wcrtomb(char * __s, wchar_t __w, mbstate_t *__st)
125{ 120{
126 if (__s && MB_LEN_MAX > __bos(__s, 2)) { 121 if (__s && MB_LEN_MAX > __bos(__s, 2)) {
@@ -139,7 +134,6 @@ _FORTIFY_FN(wcrtomb) size_t wcrtomb(char * __s, wchar_t __w, mbstate_t *__st)
139} 134}
140#endif 135#endif
141 136
142__diagnose_as_builtin(__builtin_wcscat, 1, 2)
143_FORTIFY_FN(wcscat) wchar_t *wcscat(wchar_t * _FORTIFY_POS0 __d, 137_FORTIFY_FN(wcscat) wchar_t *wcscat(wchar_t * _FORTIFY_POS0 __d,
144 const wchar_t *__s) 138 const wchar_t *__s)
145{ 139{
@@ -150,7 +144,6 @@ _FORTIFY_FN(wcscat) wchar_t *wcscat(wchar_t * _FORTIFY_POS0 __d,
150 return __orig_wcscat(__d, __s); 144 return __orig_wcscat(__d, __s);
151} 145}
152 146
153__diagnose_as_builtin(__builtin_wcscpy, 1, 2)
154_FORTIFY_FN(wcscpy) wchar_t *wcscpy(wchar_t * _FORTIFY_POS0 __d, 147_FORTIFY_FN(wcscpy) wchar_t *wcscpy(wchar_t * _FORTIFY_POS0 __d,
155 const wchar_t *__s) 148 const wchar_t *__s)
156{ 149{
@@ -161,7 +154,6 @@ _FORTIFY_FN(wcscpy) wchar_t *wcscpy(wchar_t * _FORTIFY_POS0 __d,
161 return __orig_wcscpy(__d, __s); 154 return __orig_wcscpy(__d, __s);
162} 155}
163 156
164__diagnose_as_builtin(__builtin_wcsncat, 1, 2, 3)
165_FORTIFY_FN(wcsncat) wchar_t *wcsncat(wchar_t * _FORTIFY_POS0 __d, 157_FORTIFY_FN(wcsncat) wchar_t *wcsncat(wchar_t * _FORTIFY_POS0 __d,
166 const wchar_t *__s, size_t __n) 158 const wchar_t *__s, size_t __n)
167{ 159{
@@ -179,7 +171,6 @@ _FORTIFY_FN(wcsncat) wchar_t *wcsncat(wchar_t * _FORTIFY_POS0 __d,
179 return __orig_wcsncat(__d, __s, __n); 171 return __orig_wcsncat(__d, __s, __n);
180} 172}
181 173
182__diagnose_as_builtin(__builtin_wcsncpy, 1, 2, 3)
183_FORTIFY_FN(wcsncpy) wchar_t *wcsncpy(wchar_t * _FORTIFY_POS0 __d, 174_FORTIFY_FN(wcsncpy) wchar_t *wcsncpy(wchar_t * _FORTIFY_POS0 __d,
184 const wchar_t *__s, size_t __n) 175 const wchar_t *__s, size_t __n)
185{ 176{
@@ -193,7 +184,6 @@ _FORTIFY_FN(wcsncpy) wchar_t *wcsncpy(wchar_t * _FORTIFY_POS0 __d,
193#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ 184#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
194 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) 185 || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
195#undef wcsnrtombs 186#undef wcsnrtombs
196__diagnose_as_builtin(__builtin_wcsntombs, 1, 2, 3, 4, 5)
197_FORTIFY_FN(wcsnrtombs) size_t wcsnrtombs(char * _FORTIFY_POS0 __d, 187_FORTIFY_FN(wcsnrtombs) size_t wcsnrtombs(char * _FORTIFY_POS0 __d,
198 const wchar_t **__s, size_t __wn, 188 const wchar_t **__s, size_t __wn,
199 size_t __n, mbstate_t *__st) 189 size_t __n, mbstate_t *__st)
@@ -215,7 +205,6 @@ _FORTIFY_FN(wcsnrtombs) size_t wcsnrtombs(char * _FORTIFY_POS0 __d,
215} 205}
216#endif 206#endif
217 207
218__diagnose_as_builtin(__builtin_wcsrtombs, 1, 2, 3, 4)
219_FORTIFY_FN(wcsrtombs) size_t wcsrtombs(char * _FORTIFY_POS0 __d, 208_FORTIFY_FN(wcsrtombs) size_t wcsrtombs(char * _FORTIFY_POS0 __d,
220 const wchar_t **__s, size_t __n, 209 const wchar_t **__s, size_t __n,
221 mbstate_t *__st) 210 mbstate_t *__st)
@@ -230,7 +219,6 @@ _FORTIFY_FN(wcsrtombs) size_t wcsrtombs(char * _FORTIFY_POS0 __d,
230} 219}
231 220
232__access(write_only, 1, 3) 221__access(write_only, 1, 3)
233__diagnose_as_builtin(__builtin_wcstombs, 1, 2, 3)
234_FORTIFY_FN(wcstombs) size_t wcstombs(char * _FORTIFY_POS0 __s, 222_FORTIFY_FN(wcstombs) size_t wcstombs(char * _FORTIFY_POS0 __s,
235 const wchar_t *__ws, size_t __n) 223 const wchar_t *__ws, size_t __n)
236{ 224{
@@ -241,7 +229,6 @@ _FORTIFY_FN(wcstombs) size_t wcstombs(char * _FORTIFY_POS0 __s,
241 return __orig_wcstombs(__s, __ws, __n); 229 return __orig_wcstombs(__s, __ws, __n);
242} 230}
243 231
244__diagnose_as_builtin(__builtin_wctomb, 1, 2)
245_FORTIFY_FN(wctomb) int wctomb(char * _FORTIFY_POS0 __s, wchar_t __w) 232_FORTIFY_FN(wctomb) int wctomb(char * _FORTIFY_POS0 __s, wchar_t __w)
246{ 233{
247 size_t __b = __bos(__s, 0); 234 size_t __b = __bos(__s, 0);
@@ -251,7 +238,6 @@ _FORTIFY_FN(wctomb) int wctomb(char * _FORTIFY_POS0 __s, wchar_t __w)
251 return __orig_wctomb(__s, __w); 238 return __orig_wctomb(__s, __w);
252} 239}
253 240
254__diagnose_as_builtin(__builtin_wmemcpy, 1, 2, 3)
255_FORTIFY_FN(wmemcpy) wchar_t *wmemcpy(wchar_t * _FORTIFY_POS0 __d, 241_FORTIFY_FN(wmemcpy) wchar_t *wmemcpy(wchar_t * _FORTIFY_POS0 __d,
256 const wchar_t *__s, size_t __n) 242 const wchar_t *__s, size_t __n)
257{ 243{
@@ -262,7 +248,6 @@ _FORTIFY_FN(wmemcpy) wchar_t *wmemcpy(wchar_t * _FORTIFY_POS0 __d,
262 return __orig_wmemcpy(__d, __s, __n); 248 return __orig_wmemcpy(__d, __s, __n);
263} 249}
264 250
265__diagnose_as_builtin(__builtin_wmemmove, 1, 2, 3)
266_FORTIFY_FN(wmemmove) wchar_t *wmemmove(wchar_t * _FORTIFY_POS0 __d, 251_FORTIFY_FN(wmemmove) wchar_t *wmemmove(wchar_t * _FORTIFY_POS0 __d,
267 const wchar_t *__s, size_t __n) 252 const wchar_t *__s, size_t __n)
268{ 253{
@@ -273,7 +258,6 @@ _FORTIFY_FN(wmemmove) wchar_t *wmemmove(wchar_t * _FORTIFY_POS0 __d,
273 return __orig_wmemmove(__d, __s, __n); 258 return __orig_wmemmove(__d, __s, __n);
274} 259}
275 260
276__diagnose_as_builtin(__builtin_wmemset, 1, 2, 3)
277_FORTIFY_FN(wmemset) wchar_t *wmemset(wchar_t * _FORTIFY_POS0 __s, 261_FORTIFY_FN(wmemset) wchar_t *wmemset(wchar_t * _FORTIFY_POS0 __s,
278 wchar_t __c, size_t __n) 262 wchar_t __c, size_t __n)
279{ 263{