changeset 37247:ef0f55e99386

test-xvasprintf: disable some -Wformat-security diagnostics * tests/test-xvasprintf.c: Disable -Wformat-zero-length and -Wformat-nonliteral checks, as these edge cases are part of the test.
author Ivailo <xakepa10@gmail.com>
date Tue, 03 Dec 2013 14:20:22 +0000
parents 5cfb3a67238d
children 2bb08acbb90a
files ChangeLog tests/test-xvasprintf.c
diffstat 2 files changed, 13 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Dec 03 10:34:13 2013 -0700
+++ b/ChangeLog	Tue Dec 03 14:20:22 2013 +0000
@@ -1,3 +1,9 @@
+2013-12-03  Ivailo  <xakepa10@gmail.com>
+
+	test-xvasprintf: (trivial) fix to disable some -Wformat-security diags
+	* tests/test-xvasprintf.c: Disable -Wformat-zero-length and
+	-Wformat-nonliteral checks, as these edge cases are part of the test.
+
 2013-12-03  Eric Blake  <eblake@redhat.com>
 
 	regex: avoid glibc deadlock during configure
--- a/tests/test-xvasprintf.c	Tue Dec 03 10:34:13 2013 -0700
+++ b/tests/test-xvasprintf.c	Tue Dec 03 14:20:22 2013 +0000
@@ -16,6 +16,13 @@
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
 
+/* Tell GCC not to warn about the specific edge cases tested here.  */
+#if (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) || 4 < __GNUC__
+# pragma GCC diagnostic ignored "-Wformat-zero-length"
+# pragma GCC diagnostic ignored "-Wformat-nonliteral"
+# pragma GCC diagnostic ignored "-Wformat-security"
+#endif
+
 #include <config.h>
 
 #include "xvasprintf.h"