summaryrefslogtreecommitdiff
path: root/include/stdlib.h
diff options
context:
space:
mode:
authorjvoisin2023-09-21 15:50:32 +0200
committerjvoisin2023-09-21 15:50:32 +0200
commit8c2352b985b1bf69efb965ba15f5e300eb7e8e12 (patch)
tree9901e915156ca32c0b9f006f3139ba34958f68ef /include/stdlib.h
parent46add4c4aecbbb8edb4b70ac5ed3a8c144f497ee (diff)
Properly enable diagnose_as_builtin attribute
Diffstat (limited to 'include/stdlib.h')
-rw-r--r--include/stdlib.h5
1 files changed, 0 insertions, 5 deletions
diff --git a/include/stdlib.h b/include/stdlib.h
index 1a92bff..734f0e6 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -43,7 +43,6 @@ extern "C" {
43__malloc(malloc (free, 1)) 43__malloc(malloc (free, 1))
44__alloc_size(1) 44__alloc_size(1)
45__warn_unused_result 45__warn_unused_result
46__diagnose_as_builtin(__builtin_malloc, 1)
47_FORTIFY_FN(malloc) void *malloc(size_t __s) 46_FORTIFY_FN(malloc) void *malloc(size_t __s)
48{ 47{
49 return __orig_malloc(__s); 48 return __orig_malloc(__s);
@@ -51,7 +50,6 @@ _FORTIFY_FN(malloc) void *malloc(size_t __s)
51 50
52__alloc_size(2) 51__alloc_size(2)
53__warn_unused_result 52__warn_unused_result
54__diagnose_as_builtin(__builtin_realloc, 1, 2)
55_FORTIFY_FN(realloc) void *realloc(void *__p, size_t __s) 53_FORTIFY_FN(realloc) void *realloc(void *__p, size_t __s)
56{ 54{
57 return __orig_realloc(__p, __s); 55 return __orig_realloc(__p, __s);
@@ -59,7 +57,6 @@ _FORTIFY_FN(realloc) void *realloc(void *__p, size_t __s)
59 57
60__alloc_size(1, 2) 58__alloc_size(1, 2)
61__warn_unused_result 59__warn_unused_result
62__diagnose_as_builtin(__builtin_calloc, 1, 2)
63_FORTIFY_FN(calloc) void *calloc(size_t __n, size_t __s) 60_FORTIFY_FN(calloc) void *calloc(size_t __n, size_t __s)
64{ 61{
65 return __orig_calloc(__n, __s); 62 return __orig_calloc(__n, __s);
@@ -69,7 +66,6 @@ _FORTIFY_FN(calloc) void *calloc(size_t __n, size_t __s)
69#undef reallocarray 66#undef reallocarray
70__alloc_size (2, 3) 67__alloc_size (2, 3)
71__warn_unused_result 68__warn_unused_result
72__diagnose_as_builtin(__builtin_reallocarray, 1, 2, 3)
73_FORTIFY_FN(reallocarray) void* reallocarray(void* __p, size_t __n, size_t __s) 69_FORTIFY_FN(reallocarray) void* reallocarray(void* __p, size_t __n, size_t __s)
74{ 70{
75 return __orig_reallocarray(__p, __n, __s); 71 return __orig_reallocarray(__p, __n, __s);
@@ -79,7 +75,6 @@ _FORTIFY_FN(reallocarray) void* reallocarray(void* __p, size_t __n, size_t __s)
79/* FIXME clang */ 75/* FIXME clang */
80#if (defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)) && !defined(__clang__) 76#if (defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)) && !defined(__clang__)
81#undef realpath 77#undef realpath
82__diagnose_as_builtin(__builtin_realpath, 1, 2)
83__warning_if(__p == NULL, "'realpath' called with path set to `NULL`; did you invert the arguments?") 78__warning_if(__p == NULL, "'realpath' called with path set to `NULL`; did you invert the arguments?")
84_FORTIFY_FN(realpath) char *realpath(const char *__p, char *__r) 79_FORTIFY_FN(realpath) char *realpath(const char *__p, char *__r)
85{ 80{