hotspot jtreg tests take WARNING_CFLAGS_JDK_CONLY flags
Erik Joelsson
erik.joelsson at oracle.com
Fri Aug 1 17:54:56 UTC 2025
Not sure about intended. The 'JDK' variable naming was introduced to
basically mean not Hotspot. What flags that should apply to tests isn't
always clear. I don't think that flags currently assigned to variables
with JVM in the name should apply to hotspot tests. I think we just
treat all native tests the same here and give them the JDK flags. This
area could probably still need some careful sorting out and cleanup.
/Erik
On 7/10/25 08:23, Baesken, Matthias wrote:
>
> When trying the GCC static analyzer (-fanalyzer flag)
>
> diff --git a/make/autoconf/flags-cflags.m4 b/make/autoconf/flags-cflags.m4
>
> index e80d9a98957..9d1ae60047b 100644
>
> --- a/make/autoconf/flags-cflags.m4
>
> +++ b/make/autoconf/flags-cflags.m4
>
> @@ -610,7 +610,9 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
>
> # CFLAGS WARNINGS STUFF
>
> # Set JVM_CFLAGS warning handling
>
> if test "x$TOOLCHAIN_TYPE" = xgcc; then
>
> - WARNING_CFLAGS_JDK_CONLY="$WARNINGS_ENABLE_ALL_CFLAGS"
>
> + # enable -fanalyzer (but better only for gcc12 + , and also only
> for C)
>
> + # too many strange / shaky fd leak warnings
>
> + WARNING_CFLAGS_JDK_CONLY="-fanalyzer -Wno-analyzer-fd-leak
> $WARNINGS_ENABLE_ALL_CFLAGS"
>
> WARNING_CFLAGS_JDK_CXXONLY="$WARNINGS_ENABLE_ALL_CXXFLAGS"
>
> WARNING_CFLAGS_JVM="$WARNINGS_ENABLE_ALL_CXXFLAGS"
>
> I noticed that the WARNING_CFLAGS_JDK_CONLY go into the hotspot
> jtreg tests, e.g. :
>
> /jdk/test/hotspot/jtreg/runtime/ErrorHandling/libTestDwarfHelper.h:46:6:
> error: dereference of NULL '0' [CWE-476]
> [-Werror=analyzer-null-dereference]
>
> 46 | *x = 34; // Crash
>
> | ~~~^~~~
>
> 'dereference_null': event 1
>
> |
>
> | 46 | *x = 34; // Crash
>
> | | ~~~^~~~
>
> | | |
>
> | | (1) dereference of NULL '0'
>
> This might be intended but I was surprised that the HS C tests take
> WARNING_CFLAGS_JDK_CONLY !? Is this intended or not ?
>
> Best regards, Matthias
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/hotspot-dev/attachments/20250801/13911cd4/attachment.htm>
More information about the hotspot-dev
mailing list