Skip to content

Commit 7b05d3b

Browse files
committed
CMake: Remove unsigned-integer-overflow check from UBSan compiler flags because it is too noisy.
1 parent 29cc7aa commit 7b05d3b

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

cmake/EthCompilerSettings.cmake

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,10 @@ if (SANITIZE)
200200
elseif (sanitizer STREQUAL "undefined")
201201
# The following flags not used by fuzzer but used by us may create problems, so consider
202202
# disabling them: alignment, pointer-overflow.
203+
# The following flag is not used by us to reduce terminal noise
204+
# i.e., warnings printed on stderr: unsigned-integer-overflow
205+
# Note: The C++ standard does not officially consider unsigned integer overflows
206+
# to be undefined behavior since they are implementation independent.
203207
# Flags are alphabetically sorted and are for clang v10.0
204208
list(APPEND undefinedSanitizerChecks
205209
alignment
@@ -217,18 +221,12 @@ if (SANITIZE)
217221
returns-nonnull-attribute
218222
shift
219223
signed-integer-overflow
220-
unsigned-integer-overflow
221224
unreachable
222225
vla-bound
223226
vptr
224227
)
225228
list(JOIN undefinedSanitizerChecks "," sanitizerChecks)
226-
list(REMOVE_ITEM undefinedSanitizerChecks unsigned-integer-overflow)
227-
# The fuzzer excludes reports of unsigned-integer-overflow. Hence, we remove it
228-
# from the -fno-sanitize-recover checks. Consider reducing this list if we do not
229-
# want to be notified about other failed checks.
230-
list(JOIN undefinedSanitizerChecks "," dontRecoverFromChecks)
231-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=${sanitizerChecks} -fno-sanitize-recover=${dontRecoverFromChecks}")
229+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=${sanitizerChecks} -fno-sanitize-recover=${sanitizerChecks}")
232230
endif()
233231
endif()
234232

0 commit comments

Comments
 (0)