fortify-headers

standalone fortify-source implementation
git clone git://git.2f30.org/fortify-headers
Log | Files | Refs | README | LICENSE

commit eec2b5e06bdb01d20f1a1125074a379e0b154d80
parent c4c5fd41124f38a5afee02b8f604ddc21d3b199a
Author: jvoisin <julien.voisin@dustri.org>
Date:   Tue, 30 Dec 2025 11:33:08 +0100

Change __warning_if into __fortify_warning_if to fix potential conflicts

Diffstat:
Minclude/fortify-headers.h | 4++--
Minclude/stdlib.h | 2+-
Minclude/string.h | 2+-
3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/fortify-headers.h b/include/fortify-headers.h @@ -74,9 +74,9 @@ #endif #if __has_attribute (__diagnose_if) -#define __warning_if(cond, msg) __attribute__ ((__diagnose_if (cond, msg, "warning"))) +#define __fortify_warning_if(cond, msg) __attribute__ ((__diagnose_if (cond, msg, "warning"))) #else -#define __warning_if(cond, msg) +#define __fortify_warning_if(cond, msg) #endif #endif diff --git a/include/stdlib.h b/include/stdlib.h @@ -39,7 +39,7 @@ extern "C" { /* FIXME clang */ #if (defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)) && !defined(__clang__) #undef realpath -__warning_if(__p == NULL, "'realpath' called with path set to `NULL`; did you invert the arguments?") +__fortify_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) { #ifndef PATH_MAX diff --git a/include/string.h b/include/string.h @@ -71,7 +71,7 @@ _FORTIFY_FN(memmove) void *memmove(void * _FORTIFY_POS0 __d, } __fortify_access(write_only, 1, 3) -__warning_if(__c != 0 && __n == 0, "'memset' will set `0` bytes; did you invert the arguments?") +__fortify_warning_if(__c != 0 && __n == 0, "'memset' will set `0` bytes; did you invert the arguments?") _FORTIFY_FN(memset) void *memset(void * _FORTIFY_POS0 __d, int __c, size_t __n) { size_t __b = __bos(__d, 0);