Pass -Wno-unused-but-set-variable by default, not just in make develop

The Bison-generated parser skeleton otherwise triggers this warning
with Apple clang++ for `yynerrs_`.
This commit is contained in:
Rangi42
2026-05-23 01:17:33 -04:00
parent 4a173130b9
commit 5f2ee530b8
2 changed files with 8 additions and 6 deletions
+6 -5
View File
@@ -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.
+2 -1
View File
@@ -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