Skip to content

Commit 9f42ff8

Browse files
committed
8355594: Warnings occur when building with clang and enabling ubsan
Reviewed-by: erikj, jkern, ihse
1 parent edf8ce8 commit 9f42ff8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

make/autoconf/jdk-options.m4

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,10 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_UNDEFINED_BEHAVIOR_SANITIZER],
520520
# Silence them for now.
521521
UBSAN_CHECKS="-fsanitize=undefined -fsanitize=float-divide-by-zero -fno-sanitize=shift-base -fno-sanitize=alignment \
522522
$ADDITIONAL_UBSAN_CHECKS"
523-
UBSAN_CFLAGS="$UBSAN_CHECKS -Wno-stringop-truncation -Wno-format-overflow -Wno-array-bounds -Wno-stringop-overflow -fno-omit-frame-pointer -DUNDEFINED_BEHAVIOR_SANITIZER"
523+
UBSAN_CFLAGS="$UBSAN_CHECKS -Wno-array-bounds -fno-omit-frame-pointer -DUNDEFINED_BEHAVIOR_SANITIZER"
524+
if test "x$TOOLCHAIN_TYPE" = "xgcc"; then
525+
UBSAN_CFLAGS="$UBSAN_CFLAGS -Wno-format-overflow -Wno-stringop-overflow -Wno-stringop-truncation"
526+
fi
524527
UBSAN_LDFLAGS="$UBSAN_CHECKS"
525528
# On AIX, the llvm_symbolizer is not found out of the box, so we have to provide the
526529
# full qualified llvm_symbolizer path in the __ubsan_default_options() function in

0 commit comments

Comments
 (0)