Skip to content

Commit d6b4c7d

Browse files
committed
Actuall fix zero-length gnu_printf format string warning
Turns out it cannot be disabled through the pragma.
1 parent 4be1bcd commit d6b4c7d

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ xcheck_add_c_compiler_flag(-Wno-unused-parameter)
3838
xcheck_add_c_compiler_flag(-Wno-unused-but-set-variable)
3939
xcheck_add_c_compiler_flag(-Wno-array-bounds)
4040
xcheck_add_c_compiler_flag(-Wno-format-truncation)
41+
xcheck_add_c_compiler_flag(-Wno-format-zero-length)
4142
xcheck_add_c_compiler_flag(-funsigned-char)
4243

4344
# ClangCL is command line compatible with MSVC, so 'MSVC' is set.

quickjs.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34057,7 +34057,6 @@ typedef struct BCReaderState {
3405734057
} BCReaderState;
3405834058

3405934059
#ifdef DUMP_READ_OBJECT
34060-
#pragma GCC diagnostic ignored "-Wformat-zero-length"
3406134060
static void __attribute__((format(printf, 2, 3))) bc_read_trace(BCReaderState *s, const char *fmt, ...) {
3406234061
va_list ap;
3406334062
int i, n, n0;
@@ -34091,7 +34090,6 @@ static void __attribute__((format(printf, 2, 3))) bc_read_trace(BCReaderState *s
3409134090
if (strchr(fmt, '{'))
3409234091
s->level++;
3409334092
}
34094-
#pragma GCC diagnostic warning "-Wformat-zero-length"
3409534093
#else
3409634094
#define bc_read_trace(...)
3409734095
#endif

0 commit comments

Comments
 (0)