[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-diffutils] Building diffutils 3.3 with hardening flags

From: Santiago Vila
Subject: [bug-diffutils] Building diffutils 3.3 with hardening flags
Date: Mon, 12 Aug 2013 17:57:46 +0200 (CEST)
User-agent: Alpine 2.02 (DEB 1266 2009-07-14)


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 

--- 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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]