diff --git a/CMakeLists.txt b/CMakeLists.txt index 0732bec0..e867bba9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -162,10 +162,7 @@ if(MSVC) ) add_definitions(/D_CRT_SECURE_NO_WARNINGS) else() - add_compile_options(-Wall -pedantic -fno-exceptions -fno-rtti -Wno-unknown-warning-option - # C++20 allows macros to take zero variadic arguments. - # Some versions of Clang don't recognize this, and treat them as a GNU extension. - -Wno-gnu-zero-variadic-macro-arguments) + add_compile_options(-Wall -pedantic -Wno-unknown-warning-option -fno-exceptions -fno-rtti) if(MORE_WARNINGS) add_compile_options(-Wextra @@ -174,11 +171,15 @@ else() -Wstringop-overflow=4 -Wtrampolines -Wundef -Wuninitialized -Wunused -Wshadow -Wformat=2 -Wformat-overflow=2 -Wformat-truncation=1 -Wno-format-nonliteral -Wno-strict-overflow - -Wno-unused-but-set-variable # bison's `yynerrs_` is incremented but unused -Wno-type-limits -Wno-tautological-constant-out-of-range-compare -Wvla) # MSVC does not support VLAs endif() + add_compile_options(-Wno-unused-but-set-variable # bison's `yynerrs_` is incremented but unused + # C++20 allows macros to take zero variadic arguments. + # Some versions of Clang don't recognize this, and treat them as a GNU extension. + -Wno-gnu-zero-variadic-macro-arguments) + if(MINGW) # MinGW warns about format specifiers like `%z` and `%j`, which are missing on Windows XP and earlier. # We rely on runtimes more modern than that, so we can ignore those warnings. diff --git a/Makefile b/Makefile index 6ccda11e..80a15c6a 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,8 @@ PNGLDLIBS := `${PKG_CONFIG} --libs-only-l libpng` # Note: if this comes up empty, `version.cpp` will automatically fall back to last release number VERSION_STRING := `git --git-dir=.git -c safe.directory='*' describe --tags --dirty --always 2>/dev/null` -WARNFLAGS := -Wall -pedantic -Wno-unknown-warning-option -Wno-gnu-zero-variadic-macro-arguments +WARNFLAGS := -Wall -pedantic -Wno-unknown-warning-option \ + -Wno-gnu-zero-variadic-macro-arguments -Wno-unused-but-set-variable # Overridable CXXFLAGS CXXFLAGS ?= -O3 -flto -DNDEBUG