mirror of
https://github.com/gbdev/rgbds.git
synced 2026-07-03 22:40:03 +00:00
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:
+6
-5
@@ -162,10 +162,7 @@ if(MSVC)
|
|||||||
)
|
)
|
||||||
add_definitions(/D_CRT_SECURE_NO_WARNINGS)
|
add_definitions(/D_CRT_SECURE_NO_WARNINGS)
|
||||||
else()
|
else()
|
||||||
add_compile_options(-Wall -pedantic -fno-exceptions -fno-rtti -Wno-unknown-warning-option
|
add_compile_options(-Wall -pedantic -Wno-unknown-warning-option -fno-exceptions -fno-rtti)
|
||||||
# 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(MORE_WARNINGS)
|
if(MORE_WARNINGS)
|
||||||
add_compile_options(-Wextra
|
add_compile_options(-Wextra
|
||||||
@@ -174,11 +171,15 @@ else()
|
|||||||
-Wstringop-overflow=4 -Wtrampolines -Wundef -Wuninitialized -Wunused -Wshadow
|
-Wstringop-overflow=4 -Wtrampolines -Wundef -Wuninitialized -Wunused -Wshadow
|
||||||
-Wformat=2 -Wformat-overflow=2 -Wformat-truncation=1
|
-Wformat=2 -Wformat-overflow=2 -Wformat-truncation=1
|
||||||
-Wno-format-nonliteral -Wno-strict-overflow
|
-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
|
-Wno-type-limits -Wno-tautological-constant-out-of-range-compare
|
||||||
-Wvla) # MSVC does not support VLAs
|
-Wvla) # MSVC does not support VLAs
|
||||||
endif()
|
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)
|
if(MINGW)
|
||||||
# MinGW warns about format specifiers like `%z` and `%j`, which are missing on Windows XP and earlier.
|
# 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.
|
# We rely on runtimes more modern than that, so we can ignore those warnings.
|
||||||
|
|||||||
@@ -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
|
# 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`
|
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
|
# Overridable CXXFLAGS
|
||||||
CXXFLAGS ?= -O3 -flto -DNDEBUG
|
CXXFLAGS ?= -O3 -flto -DNDEBUG
|
||||||
|
|||||||
Reference in New Issue
Block a user