mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Disable object-size analysis if optimization set to -O0
This commit is contained in:
parent
98b505e9dc
commit
1941fd80f2
1 changed files with 7 additions and 1 deletions
|
@ -178,7 +178,6 @@ if ( ZEEK_SANITIZERS )
|
|||
# list(APPEND _check_list "nullability-assign") # Not normally part of "undefined"
|
||||
# list(APPEND _check_list "nullability-return") # Not normally part of "undefined"
|
||||
# list(APPEND _check_list "objc-cast") # Not truly UB
|
||||
list(APPEND _check_list "object-size")
|
||||
# list(APPEND _check_list "pointer-overflow") # Not implemented in older GCCs
|
||||
list(APPEND _check_list "return")
|
||||
list(APPEND _check_list "returns-nonnull-attribute")
|
||||
|
@ -190,6 +189,13 @@ if ( ZEEK_SANITIZERS )
|
|||
list(APPEND _check_list "vla-bound")
|
||||
# list(APPEND _check_list "vptr") # TODO: fix associated errors
|
||||
|
||||
# Clang complains if this one is defined and the optimizer is set to -O0. We
|
||||
# only set that optimization level if NO_OPTIMIZATIONS is passed, so disable
|
||||
# the option if that's set.
|
||||
if ( NOT DEFINED ENV{NO_OPTIMIZATIONS} )
|
||||
list(APPEND _check_list "object-size")
|
||||
endif ()
|
||||
|
||||
string(REPLACE ";" "," _ub_checks "${_check_list}")
|
||||
set(ZEEK_SANITIZER_UB_CHECKS "${_ub_checks}" CACHE INTERNAL "" FORCE)
|
||||
else ()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue