commit 8c2352b985b1bf69efb965ba15f5e300eb7e8e12
parent 46add4c4aecbbb8edb4b70ac5ed3a8c144f497ee
Author: jvoisin <julien.voisin@dustri.org>
Date: Thu, 21 Sep 2023 15:50:32 +0200
Properly enable diagnose_as_builtin attribute
Diffstat:
8 files changed, 30 insertions(+), 50 deletions(-)
diff --git a/include/fortify-headers.h b/include/fortify-headers.h
@@ -100,8 +100,8 @@
#define __alloc_size(...)
#endif
-#if __has_attribute (__diagnose_as_builtin)
-#define __diagnose_as_builtin(...) __attribute__ ((__diagnose_as_builtin (__VA_ARGS__)))
+#if __has_attribute (diagnose_as_builtin)
+#define __diagnose_as_builtin(...) __attribute__ ((diagnose_as_builtin (__VA_ARGS__)))
#else
#define __diagnose_as_builtin(...)
#endif
diff --git a/include/poll.h b/include/poll.h
@@ -31,7 +31,6 @@ extern "C" {
#undef poll
-__diagnose_as_builtin(__builtin_pollfd, 1, 2, 3)
_FORTIFY_FN(poll) int poll(struct pollfd * _FORTIFY_POS0 __f, nfds_t __n, int __s)
{
size_t __b = __bos(__f, 0);
@@ -43,7 +42,6 @@ _FORTIFY_FN(poll) int poll(struct pollfd * _FORTIFY_POS0 __f, nfds_t __n, int __
#if defined(_GNU_SOURCE) && !_REDIR_TIME64
#undef ppoll
-__diagnose_as_builtin(__builtin_ppollfd, 1, 2, 3, 4)
_FORTIFY_FN(ppoll) int ppoll(struct pollfd * _FORTIFY_POS0 __f, nfds_t __n,
const struct timespec *__s, const sigset_t *__m)
{
diff --git a/include/stdio.h b/include/stdio.h
@@ -40,14 +40,12 @@ extern "C" {
#undef vsprintf
__access(read_only, 2)
-__diagnose_as_builtin(__builtin_fdopen, 1, 2)
_FORTIFY_FN(fdopen) FILE *fdopen(int __f, const char* _FORTIFY_POS0 __m)
{
return __orig_fdopen(__f, __m);
}
__access(write_only, 1, 2)
-__diagnose_as_builtin(__builtin_fgets, 1, 2, 3)
_FORTIFY_FN(fgets) char *fgets(char * _FORTIFY_POS0 __s, int __n, FILE *__f)
{
size_t __b = __bos(__s, 0);
@@ -58,7 +56,6 @@ _FORTIFY_FN(fgets) char *fgets(char * _FORTIFY_POS0 __s, int __n, FILE *__f)
}
__malloc(malloc (fclose, 1))
-__diagnose_as_builtin(__builtin_fmemopen, 1, 2, 3)
_FORTIFY_FN(fmemopen) FILE *fmemopen(void* _FORTIFY_POS0 __b, size_t __s, const char* _FORTIFY_POS0 __m)
{
return __orig_fmemopen(__b, __s, __m);
@@ -67,14 +64,12 @@ _FORTIFY_FN(fmemopen) FILE *fmemopen(void* _FORTIFY_POS0 __b, size_t __s, const
__access(read_only, 1)
__access(read_only, 2)
__malloc(malloc (fclose, 1))
-__diagnose_as_builtin(__builtin_fopen, 1, 2)
_FORTIFY_FN(fopen) FILE *fopen(const char* _FORTIFY_POS0 __p, const char* _FORTIFY_POS0 __m)
{
return __orig_fopen(__p, __m);
}
__access(write_only, 1)
-__diagnose_as_builtin(__builtin_fread, 1, 2, 3, 4)
_FORTIFY_FN(fread) size_t fread(void * _FORTIFY_POS0 __d, size_t __n,
size_t __m, FILE *__f)
{
@@ -88,7 +83,6 @@ _FORTIFY_FN(fread) size_t fread(void * _FORTIFY_POS0 __d, size_t __n,
}
__access(read_only, 1)
-__diagnose_as_builtin(__builtin_fwrite, 1, 2, 3, 4)
_FORTIFY_FN(fwrite) size_t fwrite(const void * _FORTIFY_POS0 __d, size_t __n,
size_t __m, FILE *__f)
{
@@ -104,7 +98,6 @@ _FORTIFY_FN(fwrite) size_t fwrite(const void * _FORTIFY_POS0 __d, size_t __n,
__access(read_only, 1)
__access(read_only, 2)
__malloc(malloc (pclose, 1))
-__diagnose_as_builtin(__builtin_fwrite, 1, 2)
_FORTIFY_FN(popen) FILE *popen(const char* _FORTIFY_POS0 __c, const char* _FORTIFY_POS0 __t)
{
return __orig_popen(__c, __t);
@@ -122,7 +115,9 @@ _FORTIFY_FN(tmpfile) FILE *tmpfile(void)
__access(read_write, 1, 2)
__access(read_only, 3)
__format(printf, 3, 0)
+#if __has_builtin(__builtin_vsnprintf)
__diagnose_as_builtin(__builtin_vsnprintf, 1, 2, 3, 4)
+#endif
_FORTIFY_FN(vsnprintf) int vsnprintf(char * _FORTIFY_POS0 __s, size_t __n,
const char *__f, __builtin_va_list __v)
{
@@ -136,7 +131,9 @@ _FORTIFY_FN(vsnprintf) int vsnprintf(char * _FORTIFY_POS0 __s, size_t __n,
__format(printf, 2, 0)
__access(read_write, 1)
__access(read_only, 2)
+#if __has_builtin(__builtin_vsprintf)
__diagnose_as_builtin(__builtin_vsprintf, 1, 2, 3)
+#endif
_FORTIFY_FN(vsprintf) int vsprintf(char * _FORTIFY_POS0 __s, const char *__f,
__builtin_va_list __v)
{
diff --git a/include/stdlib.h b/include/stdlib.h
@@ -43,7 +43,6 @@ extern "C" {
__malloc(malloc (free, 1))
__alloc_size(1)
__warn_unused_result
-__diagnose_as_builtin(__builtin_malloc, 1)
_FORTIFY_FN(malloc) void *malloc(size_t __s)
{
return __orig_malloc(__s);
@@ -51,7 +50,6 @@ _FORTIFY_FN(malloc) void *malloc(size_t __s)
__alloc_size(2)
__warn_unused_result
-__diagnose_as_builtin(__builtin_realloc, 1, 2)
_FORTIFY_FN(realloc) void *realloc(void *__p, size_t __s)
{
return __orig_realloc(__p, __s);
@@ -59,7 +57,6 @@ _FORTIFY_FN(realloc) void *realloc(void *__p, size_t __s)
__alloc_size(1, 2)
__warn_unused_result
-__diagnose_as_builtin(__builtin_calloc, 1, 2)
_FORTIFY_FN(calloc) void *calloc(size_t __n, size_t __s)
{
return __orig_calloc(__n, __s);
@@ -69,7 +66,6 @@ _FORTIFY_FN(calloc) void *calloc(size_t __n, size_t __s)
#undef reallocarray
__alloc_size (2, 3)
__warn_unused_result
-__diagnose_as_builtin(__builtin_reallocarray, 1, 2, 3)
_FORTIFY_FN(reallocarray) void* reallocarray(void* __p, size_t __n, size_t __s)
{
return __orig_reallocarray(__p, __n, __s);
@@ -79,7 +75,6 @@ _FORTIFY_FN(reallocarray) void* reallocarray(void* __p, size_t __n, size_t __s)
/* FIXME clang */
#if (defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)) && !defined(__clang__)
#undef realpath
-__diagnose_as_builtin(__builtin_realpath, 1, 2)
__warning_if(__p == NULL, "'realpath' called with path set to `NULL`; did you invert the arguments?")
_FORTIFY_FN(realpath) char *realpath(const char *__p, char *__r)
{
diff --git a/include/string.h b/include/string.h
@@ -40,7 +40,9 @@ extern "C" {
__access(write_only, 1, 3)
__access(read_only, 2, 3)
+#if __has_builtin(__builtin_mempcpy)
__diagnose_as_builtin(__builtin_memcpy, 1, 2, 3)
+#endif
_FORTIFY_FN(memcpy) void *memcpy(void * _FORTIFY_POS0 __od,
const void * _FORTIFY_POS0 __os, size_t __n)
__error_if((__bos(__od, 0) < __n), "'memcpy' called with `n` bigger than the size of `d`.")
@@ -59,7 +61,9 @@ __error_if((__bos(__od, 0) < __n), "'memcpy' called with `n` bigger than the siz
__access(write_only, 1, 3)
__access(read_only, 2, 3)
+#if __has_builtin(__builtin_memmove)
__diagnose_as_builtin(__builtin_memmove, 1, 2, 3)
+#endif
_FORTIFY_FN(memmove) void *memmove(void * _FORTIFY_POS0 __d,
const void * _FORTIFY_POS0 __s, size_t __n)
{
@@ -72,7 +76,9 @@ _FORTIFY_FN(memmove) void *memmove(void * _FORTIFY_POS0 __d,
}
__access(write_only, 1, 3)
+#if __has_builtin(__builtin_memset)
__diagnose_as_builtin(__builtin_memset, 1, 2, 3)
+#endif
_FORTIFY_FN(memset) void *memset(void * _FORTIFY_POS0 __d, int __c, size_t __n)
__warning_if(__c != 0 && __n == 0, "'memset' will set `0` bytes; did you invert the arguments?")
{
@@ -84,7 +90,9 @@ __warning_if(__c != 0 && __n == 0, "'memset' will set `0` bytes; did you invert
}
__access(read_only, 1, 3)
+#if __has_builtin(__builtin_memchr)
__diagnose_as_builtin(__builtin_memchr, 1, 2, 3)
+#endif
_FORTIFY_FN(memchr) void *memchr(const void * _FORTIFY_POS0 __d, int __c, size_t __n)
{
size_t __b = __bos(__d, 0);
@@ -95,7 +103,6 @@ _FORTIFY_FN(memchr) void *memchr(const void * _FORTIFY_POS0 __d, int __c, size_t
}
__access(read_only, 1, 2)
-__diagnose_as_builtin(__builtin_strchr, 1, 2, 3)
_FORTIFY_FN(strchr) char *strchr(const char * _FORTIFY_POS0 __s, int __c)
{
size_t __b = __bos(__s, 0);
@@ -107,7 +114,6 @@ _FORTIFY_FN(strchr) char *strchr(const char * _FORTIFY_POS0 __s, int __c)
}
__access(read_only, 1, 2)
-__diagnose_as_builtin(__builtin_strrchr, 1, 2, 3)
_FORTIFY_FN(strrchr) char *strrchr(const char * _FORTIFY_POS0 __s, int __c)
{
size_t __b = __bos(__s, 0);
@@ -124,7 +130,9 @@ _FORTIFY_FN(strrchr) char *strrchr(const char * _FORTIFY_POS0 __s, int __c)
#undef stpcpy
__access(write_only, 1)
__access(read_only, 2)
+#if __has_builtin(__builtin_stpcpy)
__diagnose_as_builtin(__builtin_stpcpy, 1, 2)
+#endif
_FORTIFY_FN(stpcpy) char *stpcpy(char * _FORTIFY_POS0 __d, const char *__s)
{
size_t __n = strlen(__s) + 1;
@@ -141,7 +149,9 @@ _FORTIFY_FN(stpcpy) char *stpcpy(char * _FORTIFY_POS0 __d, const char *__s)
#undef stpncpy
__access(write_only, 1)
__access(read_only, 2, 3)
+#if __has_builtin(__builtin_stpncpy)
__diagnose_as_builtin(__builtin_stpncpy, 1, 2, 3)
+#endif
_FORTIFY_FN(stpncpy) char *stpncpy(char * _FORTIFY_POS0 __d, const char *__s,
size_t __n)
{
@@ -157,7 +167,9 @@ _FORTIFY_FN(stpncpy) char *stpncpy(char * _FORTIFY_POS0 __d, const char *__s,
__access (read_write, 1)
__access (read_only, 2)
+#if __has_builtin(__builtin_strcat)
__diagnose_as_builtin(__builtin_strcat, 1, 2)
+#endif
_FORTIFY_FN(strcat) char *strcat(char * _FORTIFY_POS0 __d, const char *__s)
{
size_t __b = __bos(__d, 0);
@@ -169,7 +181,9 @@ _FORTIFY_FN(strcat) char *strcat(char * _FORTIFY_POS0 __d, const char *__s)
__access (write_only, 1)
__access (read_only, 2)
+#if __has_builtin(__builtin_strcpy)
__diagnose_as_builtin(__builtin_strcpy, 1, 2)
+#endif
_FORTIFY_FN(strcpy) char *strcpy(char * _FORTIFY_POS0 __d, const char *__s)
{
size_t __n = strlen(__s) + 1;
@@ -185,7 +199,9 @@ _FORTIFY_FN(strcpy) char *strcpy(char * _FORTIFY_POS0 __d, const char *__s)
__access (read_write, 1)
__access (read_only, 2, 3)
+#if __has_builtin(__builtin_strncat)
__diagnose_as_builtin(__builtin_strncat, 1, 2, 3)
+#endif
_FORTIFY_FN(strncat) char *strncat(char * _FORTIFY_POS0 __d, const char *__s,
size_t __n)
{
@@ -202,7 +218,9 @@ _FORTIFY_FN(strncat) char *strncat(char * _FORTIFY_POS0 __d, const char *__s,
__access (write_only, 1)
__access (read_only, 2, 3)
+#if __has_builtin(__builtin_strncpy)
__diagnose_as_builtin(__builtin_strncpy, 1, 2, 3)
+#endif
_FORTIFY_FN(strncpy) char *strncpy(char * _FORTIFY_POS0 __d,
const char *__s, size_t __n)
{
@@ -219,7 +237,9 @@ _FORTIFY_FN(strncpy) char *strncpy(char * _FORTIFY_POS0 __d,
#undef mempcpy
__access(write_only, 1)
__access(read_only, 2, 3)
+#if __has_builtin(__builtin_mempcpy)
__diagnose_as_builtin(__builtin_mempcpy, 1, 2, 3)
+#endif
_FORTIFY_FN(mempcpy) void *mempcpy(void * _FORTIFY_POS0 __d,
const void * _FORTIFY_POS0 __s, size_t __n)
{
@@ -237,7 +257,6 @@ _FORTIFY_FN(mempcpy) void *mempcpy(void * _FORTIFY_POS0 __d,
#undef strlcpy
__access (read_write, 1)
__access (read_only, 2, 3)
-__diagnose_as_builtin(__builtin_strlcat, 1, 2, 3)
_FORTIFY_FN(strlcat) size_t strlcat(char * _FORTIFY_POS0 __d,
const char *__s, size_t __n)
{
@@ -250,7 +269,6 @@ _FORTIFY_FN(strlcat) size_t strlcat(char * _FORTIFY_POS0 __d,
__access (write_only, 1)
__access (read_only, 2, 3)
-__diagnose_as_builtin(__builtin_strlcpy, 1, 2, 3)
_FORTIFY_FN(strlcpy) size_t strlcpy(char * _FORTIFY_POS0 __d,
const char *__s, size_t __n)
{
diff --git a/include/strings.h b/include/strings.h
@@ -33,7 +33,6 @@ extern "C" {
#undef bzero
__access(write_only, 2, 3)
__access(read_only, 1, 3)
-__diagnose_as_builtin(__builtin_bcopy, 1, 2, 3)
_FORTIFY_FN(bcopy) void bcopy(const void * _FORTIFY_POS0 __s,
void * _FORTIFY_POS0 __d, size_t __n)
{
@@ -46,7 +45,9 @@ _FORTIFY_FN(bcopy) void bcopy(const void * _FORTIFY_POS0 __s,
}
__access(write_only, 1, 2)
+#if __has_builtin(__builtin_bzero)
__diagnose_as_builtin(__builtin_bzero, 1, 2)
+#endif
_FORTIFY_FN(bzero) void bzero(void * _FORTIFY_POS0 __s, size_t __n)
{
size_t __b = __bos(__s, 0);
diff --git a/include/unistd.h b/include/unistd.h
@@ -42,7 +42,6 @@ extern "C" {
#undef write
__access(write_only, 2, 3)
-__diagnose_as_builtin(__builtin_confstr, 1, 2, 3)
_FORTIFY_FN(confstr) size_t confstr(int __n, char * _FORTIFY_POS0 __s, size_t __l)
{
size_t __b = __bos(__s, 0);
@@ -54,7 +53,6 @@ _FORTIFY_FN(confstr) size_t confstr(int __n, char * _FORTIFY_POS0 __s, size_t __
}
__access(write_only, 1, 2)
-__diagnose_as_builtin(__builtin_getcwd, 1, 2)
_FORTIFY_FN(getcwd) char *getcwd(char * _FORTIFY_POS0 __s, size_t __l)
{
size_t __b = __bos(__s, 0);
@@ -67,7 +65,6 @@ _FORTIFY_FN(getcwd) char *getcwd(char * _FORTIFY_POS0 __s, size_t __l)
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
#undef getdomainname
__access(write_only, 1, 2)
-__diagnose_as_builtin(__builtin_getdomainname, 1, 2)
_FORTIFY_FN(getdomainname) int getdomainname(char * _FORTIFY_POS0 __s, size_t __l)
{
size_t __b = __bos(__s, 0);
@@ -78,7 +75,6 @@ _FORTIFY_FN(getdomainname) int getdomainname(char * _FORTIFY_POS0 __s, size_t __
}
#endif
-__diagnose_as_builtin(__builtin_getgroups, 1, 2)
_FORTIFY_FN(getgroups) int getgroups(int __l, gid_t * _FORTIFY_POS0 __s)
{
size_t __b = __bos(__s, 0);
@@ -89,7 +85,6 @@ _FORTIFY_FN(getgroups) int getgroups(int __l, gid_t * _FORTIFY_POS0 __s)
}
__access(write_only, 1, 2)
-__diagnose_as_builtin(__builtin_gethostname, 1, 2)
_FORTIFY_FN(gethostname) int gethostname(char * _FORTIFY_POS0 __s, size_t __l)
{
size_t __b = __bos(__s, 0);
@@ -100,7 +95,6 @@ _FORTIFY_FN(gethostname) int gethostname(char * _FORTIFY_POS0 __s, size_t __l)
}
__access(write_only, 1, 2)
-__diagnose_as_builtin(__builtin_getlogin_r, 1, 2)
_FORTIFY_FN(getlogin_r) int getlogin_r(char * _FORTIFY_POS0 __s, size_t __l)
{
size_t __b = __bos(__s, 0);
@@ -110,7 +104,6 @@ _FORTIFY_FN(getlogin_r) int getlogin_r(char * _FORTIFY_POS0 __s, size_t __l)
return __orig_getlogin_r(__s, __l);
}
-__diagnose_as_builtin(__builtin_pread, 1, 2, 3, 4)
_FORTIFY_FN(pread) ssize_t pread(int __f, void * _FORTIFY_POS0 __s,
size_t __n, off_t __o)
{
@@ -122,7 +115,6 @@ _FORTIFY_FN(pread) ssize_t pread(int __f, void * _FORTIFY_POS0 __s,
}
__access(write_only, 2, 3)
-__diagnose_as_builtin(__builtin_read, 1, 2, 3)
_FORTIFY_FN(read) ssize_t read(int __f, void * _FORTIFY_POS0 __s, size_t __n)
{
size_t __b = __bos(__s, 0);
@@ -133,7 +125,6 @@ _FORTIFY_FN(read) ssize_t read(int __f, void * _FORTIFY_POS0 __s, size_t __n)
}
__access(write_only, 2, 3)
-__diagnose_as_builtin(__builtin_readlink, 1, 2, 3)
_FORTIFY_FN(readlink) ssize_t readlink(const char *__p,
char * _FORTIFY_POS0 __s, size_t __n)
{
@@ -145,7 +136,6 @@ _FORTIFY_FN(readlink) ssize_t readlink(const char *__p,
}
__access(write_only, 3, 4)
-__diagnose_as_builtin(__builtin_readlinkat, 1, 2, 3, 4)
_FORTIFY_FN(readlinkat) ssize_t readlinkat(int __f, const char *__p,
char * _FORTIFY_POS0 __s, size_t __n)
{
@@ -157,7 +147,6 @@ _FORTIFY_FN(readlinkat) ssize_t readlinkat(int __f, const char *__p,
}
__access(write_only, 2, 3)
-__diagnose_as_builtin(__builtin_ttyname_r, 1, 2, 3)
_FORTIFY_FN(ttyname_r) int ttyname_r(int __f, char * _FORTIFY_POS0 __s,
size_t __n)
{
@@ -169,7 +158,6 @@ _FORTIFY_FN(ttyname_r) int ttyname_r(int __f, char * _FORTIFY_POS0 __s,
}
__access(read_only, 2, 3)
-__diagnose_as_builtin(__builtin_write, 1, 2, 3)
_FORTIFY_FN(write) ssize_t write(int __f, const void * _FORTIFY_POS0 __s,
size_t __n)
{
@@ -180,7 +168,6 @@ _FORTIFY_FN(write) ssize_t write(int __f, const void * _FORTIFY_POS0 __s,
return __orig_write(__f, __s, __n);
}
-__diagnose_as_builtin(__builtin_pwrite, 1, 2, 3, 4)
_FORTIFY_FN(pwrite) ssize_t pwrite(int __f, const void * _FORTIFY_POS0 __s,
size_t __n, off_t __o)
{
diff --git a/include/wchar.h b/include/wchar.h
@@ -56,7 +56,6 @@ extern "C" {
#undef wmemmove
#undef wmemset
-__diagnose_as_builtin(__builtin_fgetws, 1, 2, 3)
_FORTIFY_FN(fgetws) wchar_t *fgetws(wchar_t * _FORTIFY_POS0 __s,
int __n, FILE *__f)
{
@@ -70,7 +69,6 @@ _FORTIFY_FN(fgetws) wchar_t *fgetws(wchar_t * _FORTIFY_POS0 __s,
#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
|| defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
#undef mbsnrtowcs
-__diagnose_as_builtin(__builtin_mbsnrtowcs, 1, 2, 3, 4, 5)
_FORTIFY_FN(mbsnrtowcs) size_t mbsnrtowcs(wchar_t * _FORTIFY_POS0 __d,
const char **__s, size_t __n,
size_t __wn, mbstate_t *__st)
@@ -92,7 +90,6 @@ _FORTIFY_FN(mbsnrtowcs) size_t mbsnrtowcs(wchar_t * _FORTIFY_POS0 __d,
}
#endif
-__diagnose_as_builtin(__builtin_mbsrtowcs, 1, 2, 3, 4)
_FORTIFY_FN(mbsrtowcs) size_t mbsrtowcs(wchar_t * _FORTIFY_POS0 __d,
const char **__s, size_t __wn,
mbstate_t *__st)
@@ -107,7 +104,6 @@ _FORTIFY_FN(mbsrtowcs) size_t mbsrtowcs(wchar_t * _FORTIFY_POS0 __d,
return __r;
}
-__diagnose_as_builtin(__builtin_mbstowcs, 1, 2, 3)
_FORTIFY_FN(mbstowcs) size_t mbstowcs(wchar_t * _FORTIFY_POS0 __ws,
const char *__s, size_t __wn)
{
@@ -120,7 +116,6 @@ _FORTIFY_FN(mbstowcs) size_t mbstowcs(wchar_t * _FORTIFY_POS0 __ws,
/* FIXME clang */
#ifndef __clang__
-__diagnose_as_builtin(__builtin_wcrtomb, 1, 2, 3)
_FORTIFY_FN(wcrtomb) size_t wcrtomb(char * __s, wchar_t __w, mbstate_t *__st)
{
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)
}
#endif
-__diagnose_as_builtin(__builtin_wcscat, 1, 2)
_FORTIFY_FN(wcscat) wchar_t *wcscat(wchar_t * _FORTIFY_POS0 __d,
const wchar_t *__s)
{
@@ -150,7 +144,6 @@ _FORTIFY_FN(wcscat) wchar_t *wcscat(wchar_t * _FORTIFY_POS0 __d,
return __orig_wcscat(__d, __s);
}
-__diagnose_as_builtin(__builtin_wcscpy, 1, 2)
_FORTIFY_FN(wcscpy) wchar_t *wcscpy(wchar_t * _FORTIFY_POS0 __d,
const wchar_t *__s)
{
@@ -161,7 +154,6 @@ _FORTIFY_FN(wcscpy) wchar_t *wcscpy(wchar_t * _FORTIFY_POS0 __d,
return __orig_wcscpy(__d, __s);
}
-__diagnose_as_builtin(__builtin_wcsncat, 1, 2, 3)
_FORTIFY_FN(wcsncat) wchar_t *wcsncat(wchar_t * _FORTIFY_POS0 __d,
const wchar_t *__s, size_t __n)
{
@@ -179,7 +171,6 @@ _FORTIFY_FN(wcsncat) wchar_t *wcsncat(wchar_t * _FORTIFY_POS0 __d,
return __orig_wcsncat(__d, __s, __n);
}
-__diagnose_as_builtin(__builtin_wcsncpy, 1, 2, 3)
_FORTIFY_FN(wcsncpy) wchar_t *wcsncpy(wchar_t * _FORTIFY_POS0 __d,
const wchar_t *__s, size_t __n)
{
@@ -193,7 +184,6 @@ _FORTIFY_FN(wcsncpy) wchar_t *wcsncpy(wchar_t * _FORTIFY_POS0 __d,
#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
|| defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
#undef wcsnrtombs
-__diagnose_as_builtin(__builtin_wcsntombs, 1, 2, 3, 4, 5)
_FORTIFY_FN(wcsnrtombs) size_t wcsnrtombs(char * _FORTIFY_POS0 __d,
const wchar_t **__s, size_t __wn,
size_t __n, mbstate_t *__st)
@@ -215,7 +205,6 @@ _FORTIFY_FN(wcsnrtombs) size_t wcsnrtombs(char * _FORTIFY_POS0 __d,
}
#endif
-__diagnose_as_builtin(__builtin_wcsrtombs, 1, 2, 3, 4)
_FORTIFY_FN(wcsrtombs) size_t wcsrtombs(char * _FORTIFY_POS0 __d,
const wchar_t **__s, size_t __n,
mbstate_t *__st)
@@ -230,7 +219,6 @@ _FORTIFY_FN(wcsrtombs) size_t wcsrtombs(char * _FORTIFY_POS0 __d,
}
__access(write_only, 1, 3)
-__diagnose_as_builtin(__builtin_wcstombs, 1, 2, 3)
_FORTIFY_FN(wcstombs) size_t wcstombs(char * _FORTIFY_POS0 __s,
const wchar_t *__ws, size_t __n)
{
@@ -241,7 +229,6 @@ _FORTIFY_FN(wcstombs) size_t wcstombs(char * _FORTIFY_POS0 __s,
return __orig_wcstombs(__s, __ws, __n);
}
-__diagnose_as_builtin(__builtin_wctomb, 1, 2)
_FORTIFY_FN(wctomb) int wctomb(char * _FORTIFY_POS0 __s, wchar_t __w)
{
size_t __b = __bos(__s, 0);
@@ -251,7 +238,6 @@ _FORTIFY_FN(wctomb) int wctomb(char * _FORTIFY_POS0 __s, wchar_t __w)
return __orig_wctomb(__s, __w);
}
-__diagnose_as_builtin(__builtin_wmemcpy, 1, 2, 3)
_FORTIFY_FN(wmemcpy) wchar_t *wmemcpy(wchar_t * _FORTIFY_POS0 __d,
const wchar_t *__s, size_t __n)
{
@@ -262,7 +248,6 @@ _FORTIFY_FN(wmemcpy) wchar_t *wmemcpy(wchar_t * _FORTIFY_POS0 __d,
return __orig_wmemcpy(__d, __s, __n);
}
-__diagnose_as_builtin(__builtin_wmemmove, 1, 2, 3)
_FORTIFY_FN(wmemmove) wchar_t *wmemmove(wchar_t * _FORTIFY_POS0 __d,
const wchar_t *__s, size_t __n)
{
@@ -273,7 +258,6 @@ _FORTIFY_FN(wmemmove) wchar_t *wmemmove(wchar_t * _FORTIFY_POS0 __d,
return __orig_wmemmove(__d, __s, __n);
}
-__diagnose_as_builtin(__builtin_wmemset, 1, 2, 3)
_FORTIFY_FN(wmemset) wchar_t *wmemset(wchar_t * _FORTIFY_POS0 __s,
wchar_t __c, size_t __n)
{