Bug 268366 - java/openjdk17: fix build with clang 15
Summary: java/openjdk17: fix build with clang 15
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-java (Nobody)
URL:
Keywords:
Depends on:
Blocks: 265425
  Show dependency treegraph
 
Reported: 2022-12-14 12:49 UTC by Dimitry Andric
Modified: 2022-12-18 17:48 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (java)


Attachments
java/openjdk17: fix build with clang 15 (3.01 KB, patch)
2022-12-14 12:49 UTC, Dimitry Andric
no flags Details | Diff
java/openjdk17: fix build with clang 15 (3.01 KB, patch)
2022-12-14 14:09 UTC, Dimitry Andric
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitry Andric freebsd_committer freebsd_triage 2022-12-14 12:49:03 UTC
During an exp-run for llvm 15 (see bug 265425), it turned out that java/openjdk17 failed to build with clang 15:

  /wrkdirs/usr/ports/java/openjdk17/work/jdk17u-jdk-17.0.5-8-1/src/java.base/unix/native/libnet/DefaultProxySelector.c:374: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);
                                          ^
  /wrkdirs/usr/ports/java/openjdk17/work/jdk17u-jdk-17.0.5-8-1/src/java.base/unix/native/libnet/DefaultProxySelector.c:393: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,
                                                                ^
  /wrkdirs/usr/ports/java/openjdk17/work/jdk17u-jdk-17.0.5-8-1/src/java.base/unix/native/libnet/DefaultProxySelector.c:398: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);
                                                                       ^
  /wrkdirs/usr/ports/java/openjdk17/work/jdk17u-jdk-17.0.5-8-1/src/java.base/unix/native/libnet/DefaultProxySelector.c:399: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);
                                                                   ^
  /wrkdirs/usr/ports/java/openjdk17/work/jdk17u-jdk-17.0.5-8-1/src/java.base/unix/native/libnet/DefaultProxySelector.c:435: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);
                       ^

This is because clang 15 warns by default about functions without arguments in their prototypes. Fix this by suppressing the warning.
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2022-12-14 12:49:26 UTC
Created attachment 238777 [details]
java/openjdk17: fix build with clang 15
Comment 2 Dimitry Andric freebsd_committer freebsd_triage 2022-12-14 14:09:17 UTC
Created attachment 238784 [details]
java/openjdk17: fix build with clang 15

Fix clang version check.
Comment 3 commit-hook freebsd_committer freebsd_triage 2022-12-18 17:44:22 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=4d093f4f688f247642423498be93375d54a2a7fd

commit 4d093f4f688f247642423498be93375d54a2a7fd
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2022-12-14 12:43:35 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2022-12-18 17:36:27 +0000

    java/openjdk17: fix build with clang 15

    During an exp-run for llvm 15 (see bug 265425), it turned out that
    java/openjdk17 failed to build with clang 15:

      /wrkdirs/usr/ports/java/openjdk17/work/jdk17u-jdk-17.0.5-8-1/src/java.base/unix/native/libnet/DefaultProxySelector.c:374: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);
                                              ^
      /wrkdirs/usr/ports/java/openjdk17/work/jdk17u-jdk-17.0.5-8-1/src/java.base/unix/native/libnet/DefaultProxySelector.c:393: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,
                                                                    ^
      /wrkdirs/usr/ports/java/openjdk17/work/jdk17u-jdk-17.0.5-8-1/src/java.base/unix/native/libnet/DefaultProxySelector.c:398: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);
                                                                           ^
      /wrkdirs/usr/ports/java/openjdk17/work/jdk17u-jdk-17.0.5-8-1/src/java.base/unix/native/libnet/DefaultProxySelector.c:399: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);
                                                                       ^
      /wrkdirs/usr/ports/java/openjdk17/work/jdk17u-jdk-17.0.5-8-1/src/java.base/unix/native/libnet/DefaultProxySelector.c:435: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);
                           ^

    This is because clang 15 warns by default about functions without
    arguments in their prototypes. Fix this by suppressing the warning.

    PR:             268366
    Approved by:    portmgr (tcberner)
    MFH:            2022Q4

 java/openjdk17/Makefile | 3 +++
 1 file changed, 3 insertions(+)