Disable -Wformat-nonliteral for a tiny block of code
authorDavid Zeuthen <zeuthen@gmail.com>
Sat, 7 Jul 2012 21:34:20 +0000 (17:34 -0400)
committerDavid Zeuthen <zeuthen@gmail.com>
Sat, 7 Jul 2012 21:34:20 +0000 (17:34 -0400)
... in this case, we happen to know better than the compiler what we
are doing.

Signed-off-by: David Zeuthen <zeuthen@gmail.com>
udisks/udisksclient.c

index 3fe9133..065a59a 100644 (file)
@@ -2215,11 +2215,15 @@ udisks_client_get_id_for_display (UDisksClient *client,
           else if ((g_strcmp0 (id_type[n].version, version) == 0 && strlen (version) > 0) ||
                    (g_strcmp0 (id_type[n].version, "*") == 0 && strlen (version) > 0))
             {
+              /* we know better than the compiler here */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
               if (long_string)
                 ret = g_strdup_printf (g_dpgettext2 (GETTEXT_PACKAGE, "fs-type", id_type[n].long_name), version);
               else
                 ret = g_strdup_printf (g_dpgettext2 (GETTEXT_PACKAGE, "fs-type", id_type[n].short_name), version);
               goto out;
+#pragma GCC diagnostic pop
             }
         }
     }