diff --git a/CHANGES b/CHANGES index a9c72505a9..b47f323a13 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +5.0.0-dev.248 | 2022-04-14 08:59:34 -0700 + + * Disable object-size analysis if optimization set to -O0 (Tim Wojtulewicz, Corelight) + 5.0.0-dev.246 | 2022-04-14 10:48:19 +0200 * Allow analyzer violations to explicitly set tag. (Robin Sommer, Corelight) diff --git a/CMakeLists.txt b/CMakeLists.txt index 79ee3c74c9..812e9720f2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 () diff --git a/VERSION b/VERSION index bea2aafec0..4c76b42b07 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -5.0.0-dev.246 +5.0.0-dev.248