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