aboutsummaryrefslogtreecommitdiffstats
path: root/src/command
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-03-14 08:58:43 +0100
committerMax Kellermann <max@duempel.org>2014-03-14 08:58:43 +0100
commit88eae9dabbb57ddc697dd64e33c145775d4bb663 (patch)
tree24cbafe32958d3581b0c69eceded8f02343466df /src/command
parentf2f1801c25e3d8d936fcd828a14f5af6d3d862c9 (diff)
downloadmpd-88eae9dabbb57ddc697dd64e33c145775d4bb663.tar.gz
mpd-88eae9dabbb57ddc697dd64e33c145775d4bb663.tar.xz
mpd-88eae9dabbb57ddc697dd64e33c145775d4bb663.zip
command/{storage,file}: suppress bogus format warnings on WIN32
Diffstat (limited to 'src/command')
-rw-r--r--src/command/FileCommands.cxx11
-rw-r--r--src/command/StorageCommands.cxx11
2 files changed, 22 insertions, 0 deletions
diff --git a/src/command/FileCommands.cxx b/src/command/FileCommands.cxx
index f7ca28b50..7b69b0bd9 100644
--- a/src/command/FileCommands.cxx
+++ b/src/command/FileCommands.cxx
@@ -59,6 +59,13 @@ skip_path(const char *name_fs)
return strchr(name_fs, '\n') != nullptr;
}
+#if defined(WIN32) && GCC_CHECK_VERSION(4,6)
+/* PRIu64 causes bogus compiler warning */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat"
+#pragma GCC diagnostic ignored "-Wformat-extra-args"
+#endif
+
CommandResult
handle_listfiles_local(Client &client, const char *path_utf8)
{
@@ -109,6 +116,10 @@ handle_listfiles_local(Client &client, const char *path_utf8)
return CommandResult::OK;
}
+#if defined(WIN32) && GCC_CHECK_VERSION(4,6)
+#pragma GCC diagnostic pop
+#endif
+
gcc_pure
static bool
IsValidName(const char *p)
diff --git a/src/command/StorageCommands.cxx b/src/command/StorageCommands.cxx
index ffee8cb74..7a20fcc01 100644
--- a/src/command/StorageCommands.cxx
+++ b/src/command/StorageCommands.cxx
@@ -46,6 +46,13 @@ skip_path(const char *name_utf8)
return strchr(name_utf8, '\n') != nullptr;
}
+#if defined(WIN32) && GCC_CHECK_VERSION(4,6)
+/* PRIu64 causes bogus compiler warning */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat"
+#pragma GCC diagnostic ignored "-Wformat-extra-args"
+#endif
+
static bool
handle_listfiles_storage(Client &client, StorageDirectoryReader &reader,
Error &error)
@@ -83,6 +90,10 @@ handle_listfiles_storage(Client &client, StorageDirectoryReader &reader,
return true;
}
+#if defined(WIN32) && GCC_CHECK_VERSION(4,6)
+#pragma GCC diagnostic pop
+#endif
+
static bool
handle_listfiles_storage(Client &client, Storage &storage, const char *uri,
Error &error)