summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2016-06-13 19:15:50 +0200
committerBastien Nocera <hadess@hadess.net>2016-06-14 10:18:59 +0200
commitadac0747b773d6b81aa1893de8b4239f94df5ee6 (patch)
tree448b21e59e776450808638c5a413b4c3824ee70c
parentdadba55648543642311755b799ef32babe5f965d (diff)
downloadnautilus-adac0747b773d6b81aa1893de8b4239f94df5ee6.tar.gz
Fix "format not a string literal" warnings
With new GCC6. https://bugzilla.gnome.org/show_bug.cgi?id=767616
-rw-r--r--src/nautilus-canvas-container.c3
-rw-r--r--src/nautilus-file-operations.c7
-rw-r--r--src/nautilus-ui-utilities.c3
3 files changed, 12 insertions, 1 deletions
diff --git a/src/nautilus-canvas-container.c b/src/nautilus-canvas-container.c
index 3427a75de..3da17a0c6 100644
--- a/src/nautilus-canvas-container.c
+++ b/src/nautilus-canvas-container.c
@@ -5152,11 +5152,14 @@ get_text_ellipsis_limit_for_zoom (char **strs,
}
if (strs != NULL) {
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
for (p = strs; *p != NULL; p++) {
if (sscanf (*p, str, limit)) {
success = TRUE;
}
}
+#pragma GCC diagnostic pop
}
g_free (str);
diff --git a/src/nautilus-file-operations.c b/src/nautilus-file-operations.c
index 4076c99f6..1ec55919c 100644
--- a/src/nautilus-file-operations.c
+++ b/src/nautilus-file-operations.c
@@ -414,6 +414,8 @@ get_link_name (const char *name, int count, int max_length)
use_count = TRUE;
}
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
if (use_count)
result = g_strdup_printf (format, count, name);
else
@@ -435,7 +437,7 @@ get_link_name (const char *name, int count, int max_length)
g_free (new_name);
}
}
-
+#pragma GCC diagnostic pop
return result;
}
@@ -708,6 +710,8 @@ make_next_duplicate_name (const char *base, const char *suffix, int count, int m
}
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
if (use_count)
result = g_strdup_printf (format, base, count, suffix);
else
@@ -729,6 +733,7 @@ make_next_duplicate_name (const char *base, const char *suffix, int count, int m
g_free (new_base);
}
}
+#pragma GCC diagnostic pop
return result;
}
diff --git a/src/nautilus-ui-utilities.c b/src/nautilus-ui-utilities.c
index c0eaab40b..67acdf580 100644
--- a/src/nautilus-ui-utilities.c
+++ b/src/nautilus-ui-utilities.c
@@ -425,7 +425,10 @@ get_text_for_date_range (GPtrArray *date_range)
normalized = days / 365;
}
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
label = g_strdup_printf (get_text_for_days_ago (days), normalized);
+#pragma GCC diagnostic pop
}
g_free (formatted_date);