udev: turn off -Wformat-nonliteral for one safe case

c20e6de897 introduced a format string as
variable, but didn't turn off -Wformat-nonliteral warnings on it, thus
breaking the build. Let's fix that, by simply turning off the warning in
this case, as we know it's safe.
This commit is contained in:
Lennart Poettering
2017-05-18 22:26:12 -04:00
committed by Zbigniew Jędrzejewski-Szmek
parent 6b7af82122
commit 86a48fb6f7
+4
View File
@@ -389,8 +389,12 @@ static int names_platform(struct udev_device *dev, struct netnames *names, bool
* eg. "/sys/devices/platform/HISI00C2:00");
* The Vendor (3 or 4 char), followed by hexdecimal model number : instance id.
*/
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
if (sscanf(syspath, pattern, vendor, &model, &instance, &ethid) != 4)
return -EINVAL;
#pragma GCC diagnostic pop
if (!in_charset(vendor, validchars))
return -ENOENT;