Commit 88eae9da authored by Max Kellermann's avatar Max Kellermann

command/{storage,file}: suppress bogus format warnings on WIN32

parent f2f1801c
...@@ -59,6 +59,13 @@ skip_path(const char *name_fs) ...@@ -59,6 +59,13 @@ skip_path(const char *name_fs)
return strchr(name_fs, '\n') != nullptr; 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 CommandResult
handle_listfiles_local(Client &client, const char *path_utf8) handle_listfiles_local(Client &client, const char *path_utf8)
{ {
...@@ -109,6 +116,10 @@ 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; return CommandResult::OK;
} }
#if defined(WIN32) && GCC_CHECK_VERSION(4,6)
#pragma GCC diagnostic pop
#endif
gcc_pure gcc_pure
static bool static bool
IsValidName(const char *p) IsValidName(const char *p)
......
...@@ -46,6 +46,13 @@ skip_path(const char *name_utf8) ...@@ -46,6 +46,13 @@ skip_path(const char *name_utf8)
return strchr(name_utf8, '\n') != nullptr; 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 static bool
handle_listfiles_storage(Client &client, StorageDirectoryReader &reader, handle_listfiles_storage(Client &client, StorageDirectoryReader &reader,
Error &error) Error &error)
...@@ -83,6 +90,10 @@ handle_listfiles_storage(Client &client, StorageDirectoryReader &reader, ...@@ -83,6 +90,10 @@ handle_listfiles_storage(Client &client, StorageDirectoryReader &reader,
return true; return true;
} }
#if defined(WIN32) && GCC_CHECK_VERSION(4,6)
#pragma GCC diagnostic pop
#endif
static bool static bool
handle_listfiles_storage(Client &client, Storage &storage, const char *uri, handle_listfiles_storage(Client &client, Storage &storage, const char *uri,
Error &error) Error &error)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment