Blame SOURCES/0003-tools-csr_usb-Fix-compilation-failure.patch

e0630b
From 07a12a6685ea57be18f39e349dbc42e4af3744ed Mon Sep 17 00:00:00 2001
e0630b
From: Bastien Nocera <hadess@hadess.net>
e0630b
Date: Tue, 5 Sep 2017 10:32:15 +0200
e0630b
Subject: [PATCH 3/4] tools/csr_usb: Fix compilation failure
e0630b
e0630b
GCC's "format-nonliteral" security check is enabled as an error in
e0630b
recent versions of Fedora. Given the reduced scope of use, mark the
e0630b
error as ignorable through pragma.
e0630b
e0630b
tools/csr_usb.c: In function 'read_value':
e0630b
tools/csr_usb.c:82:2: error: format not a string literal, argument types not checked [-Werror=format-nonliteral]
e0630b
  n = fscanf(file, format, &value);
e0630b
  ^
e0630b
---
e0630b
 tools/csr_usb.c | 3 +++
e0630b
 1 file changed, 3 insertions(+)
e0630b
e0630b
diff --git a/tools/csr_usb.c b/tools/csr_usb.c
e0630b
index a1d7324f7..33e9968a2 100644
e0630b
--- a/tools/csr_usb.c
e0630b
+++ b/tools/csr_usb.c
e0630b
@@ -67,6 +67,8 @@ struct usbfs_bulktransfer {
e0630b
 #define USBFS_IOCTL_CLAIMINTF	_IOR('U', 15, unsigned int)
e0630b
 #define USBFS_IOCTL_RELEASEINTF	_IOR('U', 16, unsigned int)
e0630b
 
e0630b
+#pragma GCC diagnostic push
e0630b
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
e0630b
 static int read_value(const char *name, const char *attr, const char *format)
e0630b
 {
e0630b
 	char path[PATH_MAX];
e0630b
@@ -88,6 +90,7 @@ static int read_value(const char *name, const char *attr, const char *format)
e0630b
 	fclose(file);
e0630b
 	return value;
e0630b
 }
e0630b
+#pragma GCC diagnostic pop
e0630b
 
e0630b
 static char *check_device(const char *name)
e0630b
 {
e0630b
-- 
e0630b
2.14.1
e0630b