Skip to content

Commit e7dedbf

Browse files
committed
[build] Stop exempting code format-related warnings
Change the compiler flags to stop exempting the following types of warnings from -Werror: -Wmisleading-indentation, -Wlogical-op-parentheses, and -Wdangling-else.
1 parent e3ea9cc commit e7dedbf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,8 +288,8 @@ if (LLVM_COMPILER_IS_GCC_COMPATIBLE)
288288
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fno-common -Woverloaded-virtual -Wcast-qual -fno-strict-aliasing -pedantic -Wno-long-long -Wall -W -Wno-unused-parameter -Wwrite-strings")
289289
option(WITH_WERROR "Compile with '-Werror' C/C++ compiler flag" ON)
290290
if (WITH_WERROR)
291-
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror -Wno-error=sign-compare -Wno-error=pointer-sign -Wno-error=incompatible-pointer-types -Wno-error=string-conversion -Wno-error=misleading-indentation -Wno-error=dangling-else -Wno-error=c99-extensions -Wno-error=deprecated-register -Wno-error=format -Wno-error=format-pedantic -Wno-error=tautological-constant-out-of-range-compare -Wno-error=switch -Wno-error=covered-switch-default -Wno-error=enum-compare -Wno-error=char-subscripts -Wno-error=logical-op-parentheses -Wno-error=parentheses -Wno-error=array-bounds -Wno-error=fortify-source -Wno-error=comment")
292-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wno-error=sign-compare -Wno-error=pointer-sign -Wno-error=incompatible-pointer-types -Wno-error=string-conversion -Wno-error=misleading-indentation -Wno-error=dangling-else -Wno-error=c99-extensions -Wno-error=deprecated-register -Wno-error=format -Wno-error=format-pedantic -Wno-error=tautological-constant-out-of-range-compare -Wno-error=switch -Wno-error=covered-switch-default -Wno-error=enum-compare -Wno-error=char-subscripts -Wno-error=logical-op-parentheses -Wno-error=parentheses -Wno-error=array-bounds -Wno-error=fortify-source -Wno-error=comment")
291+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror -Wno-error=sign-compare -Wno-error=pointer-sign -Wno-error=incompatible-pointer-types -Wno-error=string-conversion -Wno-error=c99-extensions -Wno-error=deprecated-register -Wno-error=format -Wno-error=format-pedantic -Wno-error=tautological-constant-out-of-range-compare -Wno-error=switch -Wno-error=covered-switch-default -Wno-error=enum-compare -Wno-error=char-subscripts -Wno-error=parentheses -Wno-error=array-bounds -Wno-error=fortify-source -Wno-error=comment")
292+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wno-error=sign-compare -Wno-error=pointer-sign -Wno-error=incompatible-pointer-types -Wno-error=string-conversion -Wno-error=c99-extensions -Wno-error=deprecated-register -Wno-error=format -Wno-error=format-pedantic -Wno-error=tautological-constant-out-of-range-compare -Wno-error=switch -Wno-error=covered-switch-default -Wno-error=enum-compare -Wno-error=char-subscripts -Wno-error=parentheses -Wno-error=array-bounds -Wno-error=fortify-source -Wno-error=comment")
293293
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND CMAKE_CXX_COMPILER_VERSION GREATER_EQUAL 13)
294294
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-error=unused-but-set-variable")
295295
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=unused-but-set-variable")

0 commit comments

Comments
 (0)