Skip to content

Commit 56973ec

Browse files
tests/unit/test_snprintf.c: Ignore diagnostic in test
This would be wrong most of the time, but here we're testing corner cases, so let's ignore the diagnostic here. Signed-off-by: Alejandro Colomar <[email protected]>
1 parent 40fde62 commit 56973ec

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tests/unit/test_snprintf.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ test_SNPRINTF_ok(void **)
6161
assert_true(SNPRINTF(buf, "f") == strlen("f"));
6262
assert_true(strcmp(buf, "f") == 0);
6363

64+
#pragma GCC diagnostic push
65+
#pragma GCC diagnostic ignored "-Wformat-zero-length"
6466
assert_true(SNPRINTF(buf, "") == strlen(""));
67+
#pragma GCC diagnostic pop
6568
assert_true(strcmp(buf, "") == 0);
6669
}

0 commit comments

Comments
 (0)