Hello.

When building diffutils 3.3 using hardening compiler flags, I get this:

gcc -std=gnu11  -I. -I../lib -DIN_DIFFUTILS_GNULIB_TESTS=1 -I. -I. -I.. -I./.. 
-I../lib -I./../lib -D_FORTIFY_SOURCE=2  -g -O2 -fstack-protector 
--param=ssp-buffer-size=4 -Wformat -Werror=format-security -c -o 
test-xvasprintf.o test-xvasprintf.c
test-xvasprintf.c: In function 'test_xasprintf':
test-xvasprintf.c:98:5: error: format not a string literal and no format 
arguments [-Werror=format-security]
cc1: some warnings being treated as errors

As a result, I have to either disable format string checking or apply this 
patch:

--- a/gnulib-tests/test-xvasprintf.c
+++ b/gnulib-tests/test-xvasprintf.c
@@ -53,7 +53,7 @@
       free (result);
     }
 
-  {
+  if (0) {
     /* Silence gcc warning about zero-length format string.  */
     const char *empty = "";
     result = my_xasprintf (empty);


I wish there were a more simple way to fix this.

Thanks.

Reply via email to