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:
committed by
Zbigniew Jędrzejewski-Szmek
parent
6b7af82122
commit
86a48fb6f7
@@ -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, ðid) != 4)
|
||||
return -EINVAL;
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
if (!in_charset(vendor, validchars))
|
||||
return -ENOENT;
|
||||
|
||||
Reference in New Issue
Block a user