From: Lennart Poettering Date: Thu, 18 May 2017 16:25:02 +0000 (+0200) Subject: udev: turn off -Wformat-nonliteral for one safe case X-Git-Tag: v234~193^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=86a48fb6f732c30812f3d29e5564d64037aff42f;p=thirdparty%2Fsystemd.git udev: turn off -Wformat-nonliteral for one safe case c20e6de897b2378bc3f936e1e265d2d2e2450a73 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. --- diff --git a/src/udev/udev-builtin-net_id.c b/src/udev/udev-builtin-net_id.c index f385fe95658..46eb6114ff5 100644 --- a/src/udev/udev-builtin-net_id.c +++ b/src/udev/udev-builtin-net_id.c @@ -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;