Blame pl-6.6.0-xpce-Inhibit-compiler-warning-on-sscanf-without-arguments.patch

50e7af
From ad7eedc7eb9051443548392884d8c349341fe2f1 Mon Sep 17 00:00:00 2001
50e7af
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
50e7af
Date: Tue, 3 Dec 2013 10:01:55 +0100
50e7af
Subject: [PATCH] Inhibit compiler warning on sscanf() without arguments
50e7af
MIME-Version: 1.0
50e7af
Content-Type: text/plain; charset=UTF-8
50e7af
Content-Transfer-Encoding: 8bit
50e7af
50e7af
This code will not pass if GCC is invoked with
50e7af
-Werror=format-security. This is a false positive as the format string
50e7af
is sanitized before.
50e7af
50e7af
<https: bugzilla.redhat.com="" show_bug.cgi?id="1037250">
50e7af
50e7af
Signed-off-by: Petr Písař <ppisar@redhat.com>
50e7af
---
50e7af
 src/ker/goodies.c | 6 +++++-
50e7af
 1 file changed, 5 insertions(+), 1 deletion(-)
50e7af
50e7af
diff --git a/src/ker/goodies.c b/src/ker/goodies.c
50e7af
index 153a685..039858a 100644
50e7af
--- a/src/ker/goodies.c
50e7af
+++ b/src/ker/goodies.c
50e7af
@@ -845,7 +845,11 @@ scanstr(char *str, char *fmt, Any *r)
50e7af
   ar = vsscanf(str, fmt, (va_list) ptrs);
50e7af
 #else
50e7af
   switch(argn)
50e7af
-  { case 0:	ar = sscanf(str, fmt); break;
50e7af
+  {
50e7af
+#pragma GCC diagnostic push
50e7af
+#pragma GCC diagnostic ignored "-Wformat-security"
50e7af
+    case 0:	ar = sscanf(str, fmt); break;
50e7af
+#pragma GCC diagnostic pop
50e7af
     case 1:	ar = sscanf(str, fmt, ptrs[0]); break;
50e7af
     case 2:	ar = sscanf(str, fmt, ptrs[0], ptrs[1]); break;
50e7af
     case 3:	ar = sscanf(str, fmt, ptrs[0], ptrs[1], ptrs[2]);
50e7af
-- 
50e7af
1.8.3.1
50e7af