fortify-headers

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

commit 5494a3f9dce8d3cb1a4f4359084a1ef0ee15333e
parent d3e8c46239dcd317916720b823f99dc5d22b97dd
Author: jvoisin <julien.voisin@dustri.org>
Date:   Wed,  6 Dec 2023 13:37:22 +0100

Work around an erroneous `-Wformat-nonliteral` bug in gcc

See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110834

Reported-by: ksperling-apple

Diffstat:
Minclude/stdio.h | 5+++++
1 file changed, 5 insertions(+), 0 deletions(-)

diff --git a/include/stdio.h b/include/stdio.h @@ -232,6 +232,10 @@ _FORTIFY_FN(vprintf) int vprintf(const char *__f, __builtin_va_list __v) * TODO: add __diagnose_as_builtin */ +// See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110834 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wformat-nonliteral" + #undef snprintf #undef sprintf #undef printf @@ -301,6 +305,7 @@ _FORTIFY_FN(fprintf) int fprintf(FILE *__s, const char *__f, ...) #endif } +#pragma GCC diagnostic pop #endif /* __has_builtin(__builtin_va_arg_pack) */ #ifdef __cplusplus