Skip to content

Commit

Permalink
Enforce not shadowing variables
Browse files Browse the repository at this point in the history
Shadowing variable can easily lead to bugs, so let's enforce that this
is not allowed.
  • Loading branch information
CendioOssman committed Jun 24, 2024
1 parent 12b3f40 commit 02c6a1b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wformat=2 -Wvla")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wformat=2 -Wvla")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wzero-as-null-pointer-constant")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wsuggest-override")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wshadow")
# Make sure we catch these issues whilst developing
IF(CMAKE_BUILD_TYPE MATCHES Debug)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")
Expand Down

0 comments on commit 02c6a1b

Please sign in to comment.