[gnome-commander/ConvertWarningsToErrors] src/utils.cc: ignore -Wformat-nonliteral
- From: Uwe Scholz <uwescholz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-commander/ConvertWarningsToErrors] src/utils.cc: ignore -Wformat-nonliteral
- Date: Fri, 28 Apr 2017 17:12:23 +0000 (UTC)
commit 32ebe132308e1bc67a2aa8cd5fcb84e5e73bb5cb
Author: Mamoru TASAKA <mtasaka fedoraproject org>
Date: Sat Apr 29 01:47:23 2017 +0900
src/utils.cc: ignore -Wformat-nonliteral
rc/utils.cc:117:72: error: format not a string literal, argument types not checked
[-Werror=format-nonliteral]
command = g_strdup_printf (gnome_cmd_data.options.termexec, arg);
src/utils.cc:425:49: error: format not a string literal, format string not checked
[-Werror=format-nonliteral]
strftime (buf, sizeof(buf), date_format, <);
Actually neither case can actually check format, so just ignore them.
src/utils.cc | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/src/utils.cc b/src/utils.cc
index d207b75..47df526 100644
--- a/src/utils.cc
+++ b/src/utils.cc
@@ -114,7 +114,14 @@ void run_command_indir (const gchar *in_command, const gchar *dpath, gboolean te
else
arg = g_shell_quote (in_command);
+#if defined (__GNUC__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
+#endif
command = g_strdup_printf (gnome_cmd_data.options.termexec, arg);
+#if defined (__GNUC__)
+#pragma GCC diagnostic pop
+#endif
g_free (arg);
}
@@ -422,7 +429,14 @@ const gchar *time2string (time_t t, const gchar *date_format)
struct tm lt;
localtime_r (&t, <);
+#if defined (__GNUC__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
+#endif
strftime (buf, sizeof(buf), date_format, <);
+#if defined (__GNUC__)
+#pragma GCC diagnostic pop
+#endif
// convert formatted date from current locale to UTF8
gchar *loc_date = g_locale_to_utf8 (buf, -1, NULL, NULL, NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]