RFR: 8317696: Fix compilation with clang-16 [v3]

Alexey Ivanov aivanov at openjdk.org
Mon Oct 9 18:37:00 UTC 2023


On Mon, 9 Oct 2023 15:01:41 GMT, Jan Kratochvil <jkratochvil at openjdk.org> wrote:

>> `--with-toolchain-type=clang` fails the compilation for me with `clang-16.0.6-3.fc38.x86_64`
>> 
>> While the warnings can be disabled I find better to just fix them. The GTK prototypes in JDK reported by clang are either missing or wrong. 
>> 
>> 
>> src/java.base/unix/native/libnet/DefaultProxySelector.c:378:41: error: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype]
>>     proxies = (*g_proxy_resolver_lookup)(resolver, uri, NULL, &error);
>>                                         ^
>> src/java.base/unix/native/libnet/DefaultProxySelector.c:397:63: error: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype]
>>                                 (*g_network_address_parse_uri)(proxies[i], 0,
>>                                                               ^
>> src/java.base/unix/native/libnet/DefaultProxySelector.c:402:70: error: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype]
>>                             phost = (*g_network_address_get_hostname)(conn);
>>                                                                      ^
>> src/java.base/unix/native/libnet/DefaultProxySelector.c:403:66: error: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype]
>>                             pport = (*g_network_address_get_port)(conn);
>>                                                                  ^
>> src/java.base/unix/native/libnet/DefaultProxySelector.c:445:22: error: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype]
>>         (*g_strfreev)(proxies);
>>                      ^
>> src/java.base/unix/native/libnet/DefaultProxySelector.c:448:25: error: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Werror,-Wdeprecated-non-prototype]
>>         (*g_clear_error)(&error);
>>                         ^
>> Compiling X11Renderer.c (for libawt_headless.so)
>> In file included from src/java.desktop/unix/native/common/java2d/x11/X11PMBlitLoops.c:29:
>> In file included from src/java.desktop/unix/native/common/java2d/x11/X11Surf...
>
> Jan Kratochvil has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Remove declaration changes which are not required
>    - suggested by djelinski

The changes for `java.desktop` look good to me.

src/java.desktop/unix/native/common/awt/awt_GraphicsEnv.h line 53:

> 51: #define MITSHM_PERM_OWNER  (0600)
> 52: 
> 53: extern int XShmQueryExtension(Display* dpy);

I wonder if it's even needed here: the declaration should come from `X11/extensions/XShm.h` which is included.

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

Marked as reviewed by aivanov (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/16092#pullrequestreview-1665070667
PR Review Comment: https://git.openjdk.org/jdk/pull/16092#discussion_r1350667139


More information about the net-dev mailing list