Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions cmake/AISClangCompilerOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ function(get_ais_clang_warning_flags outvar compiler_version)
-Wdeprecated

# Aggressively warn about thread-safety issues
# Requires markup: https://clang.llvm.org/docs/ThreadSafetyAnalysis.html
-Wthread-safety
-Wthread-safety-beta
-Wthread-safety-negative
-Wthread-safety-verbose

# Turn this on later (generates a lot of noise now)
-Wdocumentation
Expand All @@ -50,11 +54,14 @@ function(get_ais_clang_warning_flags outvar compiler_version)

# Turn on stack protection options
-fstack-clash-protection
-fstack-protector-strong
-fstack-protector-strong # Consider -all instead of -strong

# Turn on strict flex arrays (helps ASAN, _FORTIFY_SOURCE, etc.)
-fstrict-flex-arrays=3

# Initialize local variables with a pattern
-ftrivial-auto-var-init=pattern

# Misc warnings
#
# This includes most warnings that are not enabled by default
Expand Down Expand Up @@ -123,8 +130,7 @@ function(get_ais_clang_warning_flags outvar compiler_version)
-Wmax-tokens
-Wmethod-signatures
-Wmissing-include-dirs
#-Wmissing-noreturn # Generates spurious warnings due to unimplemented void
# functions that always throw exceptions or terminate
-Wmissing-noreturn
-Wmissing-prototypes
-Wmissing-variable-declarations
-Wnarrowing
Expand Down Expand Up @@ -163,6 +169,7 @@ function(get_ais_clang_warning_flags outvar compiler_version)
-Wsuper-class-method-mismatch
-Wswitch-default
-Werror=switch-enum # To make sure we never miss a CUDA enum value
-Wtautological-constant-in-range-compare
-Wtype-limits
-Wunaligned-access
-Wundeclared-selector
Expand Down Expand Up @@ -218,6 +225,10 @@ function(get_ais_clang_warning_flags outvar compiler_version)

if(compiler_version VERSION_GREATER_EQUAL 21.0)
set(flags
# Aggressively warn about thread-safety issues
# Requires markup: https://clang.llvm.org/docs/ThreadSafetyAnalysis.html
-Wthread-safety-pointer

# Misc warnings
-Wignored-base-class-qualifiers
-Wshift-bool
Expand Down
Loading