On Mon, 5 Oct 2026 07:31:46 GMT, Matthias Baesken <[email protected]> wrote:

> We currently disable the unused-variable warning in BUILD_LIBAWT for 
> gcc/clang, this should be avoided.
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

make/modules/java.desktop/lib/AwtLibraries.gmk line 136:

> 134:     DISABLED_WARNINGS_clang_awt_ImagingLib.c := 
> deprecated-non-prototype, \
> 135:     DISABLED_WARNINGS_clang_debug_assert.c := unused-variable, \
> 136:     DISABLED_WARNINGS_clang_debug_mem.c := unused-variable, \

possibly we can update the code instead?

src/java.desktop/share/native/common/awt/debug/debug_trace.h line 2:

> 1: /*
> 2:  * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights 
> reserved.

Copyright year is not updated?

src/java.desktop/share/native/common/awt/debug/debug_trace.h line 65:

> 63: 
> 64: /* each file includes this flag indicating module trace status */
> 65: #if defined(__GNUC__) || defined(__clang__)

Just wonder, is this is common pattern we use in jdk? seems most of the time we 
want to check the "__GNUC__" and NOT "__clang__", since __GNUC__ is defined by 
the clang?

src/java.desktop/share/native/libawt/java2d/loops/AnyByteBinary.h line 200:

> 198:                                                   (SRCINFO)->bounds.x1) \
> 199:             Declare ## DSTTYPE ## InitialLoadVars(DSTINFO, DSTPTR, 
> DSTPREFIX, \
> 200:                                                   (DSTINFO)->bounds.x1) \

Why this one was marked as unused?

src/java.desktop/unix/native/libawt/awt/awt_LoadLibrary.c line 54:

> 52: static void *awtHandle = NULL;
> 53: 
> 54: typedef jint JNICALL JNI_OnLoad_type(JavaVM *vm, void *reserved);

After the patch is this one unused? Why is not it detected by the compiler?

src/java.desktop/unix/native/libawt/awt/awt_LoadLibrary.c line 106:

> 104:     char *p, *tk;
> 105:     JNI_OnLoad_type *JNI_OnLoad_ptr;
> 106:     struct utsname name;

This was the last usage of "utsname" so "#include <sys/utsname.h>" is not 
needed?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/33200#discussion_r4201216965
PR Review Comment: https://git.openjdk.org/jdk/pull/33200#discussion_r4201172491
PR Review Comment: https://git.openjdk.org/jdk/pull/33200#discussion_r4201237075
PR Review Comment: https://git.openjdk.org/jdk/pull/33200#discussion_r4201187922
PR Review Comment: https://git.openjdk.org/jdk/pull/33200#discussion_r4201196439
PR Review Comment: https://git.openjdk.org/jdk/pull/33200#discussion_r4201201917

Reply via email to