From 14905e33e142eec591c3908167f3d0a5a8015054 Mon Sep 17 00:00:00 2001 From: orbea Date: Sun, 16 Dec 2018 19:38:04 -0800 Subject: [PATCH] Fix more gcc -Wformat= warnings with C89_BUILD. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The "z" modifier was introduced in c99, but using "l" instead seems to work. setting_list.c: In function ‘setting_get_string_representation_size’: setting_list.c:175:24: warning: ISO C90 does not support the ‘z’ gnu_printf length modifier [-Wformat=] snprintf(s, len, "%" PRI_SIZET, ^~~ setting_list.c: In function ‘setting_get_string_representation_size_in_mb’: setting_list.c:183:24: warning: ISO C90 does not support the ‘z’ gnu_printf length modifier [-Wformat=] snprintf(s, len, "%" PRI_SIZET, ^~~ setting_list.c: In function ‘setting_set_with_string_representation’: setting_list.c:508:24: warning: ISO C90 does not support the ‘z’ gnu_scanf length modifier [-Wformat=] sscanf(value, "%" PRI_SIZET, setting->value.target.sizet); ^~~ libretro-common/file/config_file.c: In function ‘config_get_size_t’: libretro-common/file/config_file.c:692:32: warning: ISO C90 does not support the ‘z’ gnu_scanf length modifier [-Wformat=] if (sscanf(entry->value, "%" PRI_SIZET, &val) == 1 --- libretro-common/include/retro_miscellaneous.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libretro-common/include/retro_miscellaneous.h b/libretro-common/include/retro_miscellaneous.h index 5972c1796f..629ce12c34 100644 --- a/libretro-common/include/retro_miscellaneous.h +++ b/libretro-common/include/retro_miscellaneous.h @@ -166,7 +166,7 @@ typedef struct #endif # endif #else -# define PRI_SIZET "zu" +# define PRI_SIZET "lu" #endif #endif