diff --git a/tests/test-xvasprintf.c b/tests/test-xvasprintf.c index 453ca58..772a700 100644 --- a/tests/test-xvasprintf.c +++ b/tests/test-xvasprintf.c @@ -56,9 +56,12 @@ test_xvasprintf (void) { /* Silence gcc warning about zero-length format string. */ const char *empty = ""; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wformat-zero-length" result = my_xasprintf (empty); ASSERT (result != NULL); ASSERT (strcmp (result, "") == 0); +#pragma GCC diagnostic pop free (result); } @@ -97,9 +100,12 @@ test_xasprintf (void) and about "format not a string literal and no format" (whatever that means) . */ const char *empty = ""; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wformat-nonliteral" result = xasprintf (empty, empty); ASSERT (result != NULL); ASSERT (strcmp (result, "") == 0); +#pragma GCC diagnostic pop free (result); }