-Wformat is enabled by -Wall on GCC, so skipping -W* flags on external libs is enough to disable it. On Clang it's enabled by default, so we need to disable it explicitly.
From: Jacek Caban jacek@codeweavers.com
-Wformat is enabled by -Wall on GCC, so skipping -W* flags on external libs is enough to disable it. On Clang it's enabled by default, so we need to disable it explicitly. --- configure.ac | 3 ++- tools/makedep.c | 9 ++++----- 2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/configure.ac b/configure.ac index aba623ee6e7..34792a3cd4e 100644 --- a/configure.ac +++ b/configure.ac @@ -212,7 +212,7 @@ case "$host_cpu" in x86_64) HOST_ARCH=x86_64 ;; esac m4_set_add_all([_AC_SUBST_VARS],[HOST_ARCH]m4_foreach([cpu],[aarch64,arm,arm64ec,i386,x86_64], - [m4_foreach([var],[CC,CFLAGS,EXTRACFLAGS,LDFLAGS,DEBUG,TARGET,DELAYLOADFLAG,DISABLED_SUBDIRS],[,cpu[_]var])])) + [m4_foreach([var],[CC,CFLAGS,EXTRACFLAGS,EXTLIBCFLAGS,LDFLAGS,DEBUG,TARGET,DELAYLOADFLAG,DISABLED_SUBDIRS],[,cpu[_]var])]))
AC_CACHE_CHECK([for the directory containing the Wine tools], wine_cv_toolsdir, [wine_cv_toolsdir="$with_wine_tools" @@ -966,6 +966,7 @@ This is an error since --enable-archs=$wine_arch was requested.])]) WINE_TRY_PE_CFLAGS([-Wpointer-arith]) WINE_TRY_PE_CFLAGS([-Wlogical-op]) WINE_TRY_PE_CFLAGS([-Wabsolute-value]) + WINE_TRY_PE_CFLAGS([-Wformat],[AS_VAR_SET(${wine_arch}_EXTLIBCFLAGS,["-Wno-format"])])
case $wine_arch in i386) WINE_TRY_PE_CFLAGS([-fno-omit-frame-pointer]) diff --git a/tools/makedep.c b/tools/makedep.c index 8ce575b15ca..980a386c8e5 100644 --- a/tools/makedep.c +++ b/tools/makedep.c @@ -2365,15 +2365,13 @@ static struct strarray get_source_defines( struct makefile *make, struct incl_fi /******************************************************************* * remove_warning_flags */ -static struct strarray remove_warning_flags( struct strarray flags ) +static void remove_warning_flags( struct strarray *ret, struct strarray flags ) { unsigned int i; - struct strarray ret = empty_strarray;
for (i = 0; i < flags.count; i++) if (strncmp( flags.str[i], "-W", 2 ) || !strncmp( flags.str[i], "-Wno-", 5 )) - strarray_add( &ret, flags.str[i] ); - return ret; + strarray_add( ret, flags.str[i] ); }
@@ -4454,7 +4452,8 @@ int main( int argc, char *argv[] ) for (arch = 0; arch < archs.count; arch++) { extra_cflags[arch] = get_expanded_arch_var_array( top_makefile, "EXTRACFLAGS", arch ); - extra_cflags_extlib[arch] = remove_warning_flags( extra_cflags[arch] ); + extra_cflags_extlib[arch] = get_expanded_arch_var_array( top_makefile, "EXTLIBCFLAGS", arch ); + remove_warning_flags( &extra_cflags_extlib[arch], extra_cflags[arch] ); disabled_dirs[arch] = get_expanded_arch_var_array( top_makefile, "DISABLED_SUBDIRS", arch ); if (!is_multiarch( arch )) continue; delay_load_flags[arch] = get_expanded_arch_var( top_makefile, "DELAYLOADFLAG", arch );
This merge request was closed by Jacek Caban.
Fixed by 2863311d7c96fce9df7c932ca93f76eb2b8f51cf, thanks Alexandre!