Merge branch 'clang-format-nonliteral' into 'master'

Silence clang errors about -Wformat-nonliteral due to missing intermediate attributes

See merge request GNOME/glib!1440
This commit is contained in:
Philip Withnall 2020-05-01 16:57:53 +00:00
commit 89f964e333
3 changed files with 5 additions and 3 deletions

View File

@ -201,7 +201,7 @@ trace (const char *format,
* equivalent function for g_warning because none of the registry errors can
* result from programmer error (Microsoft programmers don't count), instead
* they will mostly occur from people messing with the registry by hand. */
static void
static void G_GNUC_PRINTF (2, 3)
g_message_win32_error (DWORD result_code,
const gchar *format,
...)
@ -312,7 +312,7 @@ handle_read_error (LONG result,
{
/* file not found means key value not set, this isn't an error for us. */
if (result != ERROR_FILE_NOT_FOUND)
g_message_win32_error (result, "Unable to query value %s/%s: %s.\n",
g_message_win32_error (result, "Unable to query value %s/%s",
path_name, value_name);
}

View File

@ -39,7 +39,7 @@
#include <sys/cygwin.h>
#endif
static void
static void G_GNUC_PRINTF (1, 2)
set_error (const gchar *format,
...)
{

View File

@ -396,6 +396,8 @@ if cc.get_id() == 'gcc' or cc.get_id() == 'clang'
# Due to function casts through (void*) we cannot support -Wpedantic:
# https://wiki.gnome.org/Projects/GLib/CompilerRequirements#Function_pointer_conversions.
'-Wno-pedantic',
# A zero-length format string shouldn't be considered an issue.
'-Wno-format-zero-length',
'-Werror=declaration-after-statement',
'-Werror=format=2',
'-Werror=implicit-function-declaration',