Actuall fix zero-length gnu_printf format string warning

Turns out it cannot be disabled through the pragma.
This commit is contained in:
Saúl Ibarra Corretgé 2024-09-11 19:14:22 +02:00
parent 4be1bcdb5e
commit d6b4c7d24f
2 changed files with 1 additions and 2 deletions

View file

@ -38,6 +38,7 @@ xcheck_add_c_compiler_flag(-Wno-unused-parameter)
xcheck_add_c_compiler_flag(-Wno-unused-but-set-variable) xcheck_add_c_compiler_flag(-Wno-unused-but-set-variable)
xcheck_add_c_compiler_flag(-Wno-array-bounds) xcheck_add_c_compiler_flag(-Wno-array-bounds)
xcheck_add_c_compiler_flag(-Wno-format-truncation) xcheck_add_c_compiler_flag(-Wno-format-truncation)
xcheck_add_c_compiler_flag(-Wno-format-zero-length)
xcheck_add_c_compiler_flag(-funsigned-char) xcheck_add_c_compiler_flag(-funsigned-char)
# ClangCL is command line compatible with MSVC, so 'MSVC' is set. # ClangCL is command line compatible with MSVC, so 'MSVC' is set.

View file

@ -34057,7 +34057,6 @@ typedef struct BCReaderState {
} BCReaderState; } BCReaderState;
#ifdef DUMP_READ_OBJECT #ifdef DUMP_READ_OBJECT
#pragma GCC diagnostic ignored "-Wformat-zero-length"
static void __attribute__((format(printf, 2, 3))) bc_read_trace(BCReaderState *s, const char *fmt, ...) { static void __attribute__((format(printf, 2, 3))) bc_read_trace(BCReaderState *s, const char *fmt, ...) {
va_list ap; va_list ap;
int i, n, n0; int i, n, n0;
@ -34091,7 +34090,6 @@ static void __attribute__((format(printf, 2, 3))) bc_read_trace(BCReaderState *s
if (strchr(fmt, '{')) if (strchr(fmt, '{'))
s->level++; s->level++;
} }
#pragma GCC diagnostic warning "-Wformat-zero-length"
#else #else
#define bc_read_trace(...) #define bc_read_trace(...)
#endif #endif