On 8/18/2009 15:09, NightStrike wrote:
+ [AS_CASE(["$enableval"],no quotes + [[[0-5]]], warning_level="$enableval", bracket the second argument Approved with those two changes and your own testing, of course.
OK, new patch attached.
Index: configure.ac =================================================================== --- configure.ac (revision 1174) +++ configure.ac (working copy) @@ -112,6 +112,43 @@ AC_CHECK_HEADER([_mingw_mac.h], [], [AC_MSG_ERROR([Please check if the mingw-w64 header set and the build/host option are set properly.])]) +#Warnings and errors, default level is 3 +AC_MSG_CHECKING([for warning levels]) +AC_ARG_ENABLE([warnings], + [AS_HELP_STRING([[--enable-warnings[=0-5]]], + [Enable compile time warnings @<:@default=3@:>@])], + [AS_CASE([$enableval], + [yes], [warning_level=3], + [no], [warning_level=0], + [[[0-5]]], [warning_level="$enableval"], + [warning_level=3])], + [warning_level=3]) +AC_MSG_RESULT([Level $warning_level]) + +#Add warning flags as appropriate. Level 4 and above are only for testing purpose. +AS_CASE([$warning_level], + [0],[ADD_C_CXX_WARNING_FLAGS="-Wall"], + [1],[ + ADD_C_CXX_WARNING_FLAGS="-Wall -Wextra" + ADD_C_ONLY_WARNING_FLAGS="-Wimplicit-function-declaration"], + [2],[ + ADD_C_CXX_WARNING_FLAGS="-Wall -Wextra -Wformat -Wstrict-aliasing -Wsystem-headers -Wshadow -Wmissing-declarations -Wpacked -Wredundant-decls -Winline" + ADD_C_ONLY_WARNING_FLAGS="-Wimplicit-function-declaration"], + [3],[ + ADD_C_CXX_WARNING_FLAGS="-Wall -Wextra -Wformat -Wstrict-aliasing -Wsystem-headers -Wshadow -Wmissing-declarations -Wpacked -Wredundant-decls -Winline -Wstrict-aliasing=3" + ADD_C_ONLY_WARNING_FLAGS="-Wimplicit-function-declaration -Wmissing-noreturn -Wmissing-prototypes"], + [4],[ + ADD_C_CXX_WARNING_FLAGS="-Wall -Wextra -Wformat -Wstrict-aliasing -Wsystem-headers -Wshadow -Wmissing-declarations -Wpacked -Wredundant-decls -Winline -Wstrict-aliasing=2 -Werror -pedantic" + ADD_C_ONLY_WARNING_FLAGS="-Wimplicit-function-declaration -Wmissing-noreturn -Wmissing-prototypes"] + [5],[ + ADD_C_CXX_WARNING_FLAGS="-Wall -Wextra -Wformat -Wstrict-aliasing -Wsystem-headers -Wshadow -Wmissing-declarations -Wpacked -Wredundant-decls -Winline -Wstrict-aliasing=2 -Werror -Wfatal-errors -pedantic -pedantic-errors" + ADD_C_ONLY_WARNING_FLAGS="-Wimplicit-function-declaration -Wmissing-noreturn -Wmissing-prototypes"] + ) + +AC_SUBST(ADD_C_ONLY_WARNING_FLAGS) +AC_SUBST(ADD_C_CXX_WARNING_FLAGS) +AC_SUBST(ADD_CXX_ONLY_WARNING_FLAGS) + AC_CONFIG_FILES([Makefile]) AC_OUTPUT @@ -125,9 +162,12 @@ AC_MSG_NOTICE([]) AC_MSG_NOTICE([Configuration Options Summary:]) AC_MSG_NOTICE([]) -AC_MSG_NOTICE([ WinCE runtime.....: $enable_libce]) -AC_MSG_NOTICE([ Win32 runtime.....: $enable_lib32]) -AC_MSG_NOTICE([ Win64 runtime.....: $enable_lib64]) +AC_MSG_NOTICE([ WinCE runtime........: $enable_libce]) +AC_MSG_NOTICE([ Win32 runtime........: $enable_lib32]) +AC_MSG_NOTICE([ Win64 runtime........: $enable_lib64]) +AC_MSG_NOTICE([ C Warning Flags......: $ADD_C_ONLY_WARNING_FLAGS]) +AC_MSG_NOTICE([ C++ Warning Flags....: $ADD_CXX_ONLY_WARNING_FLAGS]) +AC_MSG_NOTICE([ Common Warning Flags.: $ADD_C_CXX_WARNING_FLAGS]) AC_MSG_NOTICE([]) Index: Makefile.am =================================================================== --- Makefile.am (revision 1174) +++ Makefile.am (working copy) @@ -20,9 +20,9 @@ withsys= endif - AM_CPPFLAGS=-D_CRTBLD $(sysincludes) -AM_CFLAGS=-pipe $(vistasupport) -Wall -Wno-strict-aliasing -std=gnu99 +AM_CFLAGS=-pipe $(vistasupport) -std=gnu99 @ADD_C_CXX_WARNING_FLAGS@ @ADD_C_ONLY_WARNING_FLAGS@ +am_cxxfla...@add_c_cxx_warning_flags@ @ADD_CXX_ONLY_WARNING_FLAGS@ AM_DLLTOOLFLAGS=-k --as=$(AS) --output-lib $@ DTDEF=$(DLLTOOL) $(AM_DLLTOOLFLAGS) --def DTLIB=$(DTDEF) $(top_srcdir)/`echo $@ | $(SED) 's|/lib|/|;s|\.a|.def|'`
------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
