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 c04e11c commit 07fa32d
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 @@ -108,6 +108,9 @@ if (NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")

# We do not yet mark any of our overrides. Let's disable this for now
set_check_compiler_flag_cxx("-Winconsistent-missing-override" "-Wno-inconsistent-missing-override")

# 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 @@ -140,6 +140,9 @@ AX_CHECK_COMPILER_FLAGS_VAR([C++], [WARN], [-Wundefined-var-template], [-Wno-und
dnl We do not yet mark any of our overrides. Let's disable this for now
AX_CHECK_COMPILER_FLAGS_VAR([C++], [WARN], [-Winconsistent-missing-override], [-Wno-inconsistent-missing-override])

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 07fa32d

Please sign in to comment.