Skip to content

Commit

Permalink
Add sumtimes-unitialized warning.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rot127 committed Apr 10, 2024
1 parent a33678e commit 9b97384
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ set(UNIX_COMPILER_OPTIONS -Werror -Wall -Warray-bounds -Wshift-negative-value -W
include(CheckCCompilerFlag)
check_c_compiler_flag("-Wno-maybe-unitialized" SUPPORTS_MU)
check_c_compiler_flag("-Wshadow=local" SUPPORTS_SHADOWING)
check_c_compiler_flag("-Wsometimes-uninitialized" SUPPORTS_SUNINIT)

if (SUPPORTS_MU)
set(UNIX_COMPILER_OPTIONS ${UNIX_COMPILER_OPTIONS} -Wno-maybe-unitialized)
Expand All @@ -42,6 +43,10 @@ if (SUPPORTS_SHADOWING)
set(UNIX_COMPILER_OPTIONS ${UNIX_COMPILER_OPTIONS} -Wshadow=local)
endif()

if (SUPPORTS_SUNINIT)
set(UNIX_COMPILER_OPTIONS ${UNIX_COMPILER_OPTIONS} -Wsometimes-uninitialized)
endif()

if (MSVC)
add_compile_options(/W1 /w14189)
else()
Expand Down

0 comments on commit 9b97384

Please sign in to comment.