From 8c2352b985b1bf69efb965ba15f5e300eb7e8e12 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Thu, 21 Sep 2023 15:50:32 +0200 Subject: Properly enable diagnose_as_builtin attribute --- include/stdlib.h | 5 ----- 1 file changed, 5 deletions(-) (limited to 'include/stdlib.h') 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" { __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) { -- cgit v1.3