Skip to content

Commit

Permalink
BUILD: Disable -Wunused-const-variable
Browse files Browse the repository at this point in the history
This one is enabled by -Wall in Clang, but not in gcc (at least not
for C++). The warning doesn't make sense for us, especially since we
sometimes leave in unused static const values for documentation
purposes, so let's disable it.
  • Loading branch information
DrMcCoy committed Aug 26, 2020
1 parent 5654632 commit 517b20e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ if (NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")

# Disable warnings about unused local typedefs that came with GLM
set_check_compiler_flag_cxx("-Wunused-local-typedefs" "-Wno-unused-local-typedefs")

# Disable warnings about unused static const variables
set_check_compiler_flag_cxx("-Wunused-const-variable" "-Wno-unused-const-variable")
endif()

# platform specific warning settings
Expand Down
3 changes: 3 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ AX_CHECK_COMPILER_FLAGS_VAR([C++], [WARN], [-Wunused-private-field], [-Wno-unuse
dnl Disable warnings about unused local typedefs that came with GLM
AX_CHECK_COMPILER_FLAGS_VAR([C++], [WARN], [-Wunused-local-typedefs], [-Wno-unused-local-typedefs])

dnl Disable warnings about unused static const variables
AX_CHECK_COMPILER_FLAGS_VAR([C++], [WARN], [-Wunused-const-variable], [-Wno-unused-const-variable])

AC_SUBST(WARN)

dnl C++ dialect
Expand Down

0 comments on commit 517b20e

Please sign in to comment.