RFR: 8355594: Warnings occur when building with clang and enabling ubsan

Magnus Ihse Bursie ihse at openjdk.org
Mon Apr 28 19:28:45 UTC 2025


On Mon, 28 Apr 2025 15:22:50 GMT, Matthias Baesken <mbaesken at openjdk.org> wrote:

> When building ubsan-enabled binaries with the clang toolchain (e.g. on AIX or Linux), we get the following warnings :
> 
> 
> warning: unknown warning option '-Wno-stringop-truncation'; did you mean '-Wno-string-concatenation'? [-Wunknown-warning-option]
> warning: unknown warning option '-Wno-format-overflow'; did you mean '-Wno-shift-overflow'? [-Wunknown-warning-option]
> warning: unknown warning option '-Wno-stringop-overflow'; did you mean '-Wno-shift-overflow'? [-Wunknown-warning-option]

Marked as reviewed by ihse (Reviewer).

make/autoconf/jdk-options.m4 line 525:

> 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-stringop-truncation -Wno-format-overflow -Wno-stringop-overflow"

Just for the sake of my sanity, can you reorder the `-Wno-*` options in alphabetical order?

-------------

PR Review: https://git.openjdk.org/jdk/pull/24924#pullrequestreview-2800472851
PR Review Comment: https://git.openjdk.org/jdk/pull/24924#discussion_r2064376949


More information about the build-dev mailing list