Bug 268223 - java/openjdk8: fix build with clang 15
Summary: java/openjdk8: 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-07 14:57 UTC by Dimitry Andric
Modified: 2022-12-18 17:48 UTC (History)
2 users (show)

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


Attachments
java/openjdk8: fix build with clang 15 (3.15 KB, patch)
2022-12-07 14:57 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-07 14:57:24 UTC
During an exp-run for llvm 15 (see bug 265425), it turned out that java/openjdk8 failed to build with clang 15:

    /wrkdirs/usr/ports/java/openjdk8/work/jdk8u-jdk8u352-b08.1/jdk/src/share/bin/splashscreen_stubs.c:64:30: error: incompatible pointer to integer conversion returning 'void *' from a function with result type 'int' [-Wint-conversion]
        INVOKE(SplashLoadMemory, NULL)(pdata, size);
                                 ^~~~
    /usr/include/sys/_null.h:34:14: note: expanded from macro 'NULL'
    #define NULL    ((void *)0)
                    ^~~~~~~~~~~
    /wrkdirs/usr/ports/java/openjdk8/work/jdk8u-jdk8u352-b08.1/jdk/src/share/bin/splashscreen_stubs.c:60:39: note: expanded from macro 'INVOKE'
    #define INVOKE(name,def) _INVOKE(name,def,return)
                                          ^~~
    /wrkdirs/usr/ports/java/openjdk8/work/jdk8u-jdk8u352-b08.1/jdk/src/share/bin/splashscreen_stubs.c:57:25: note: expanded from macro '_INVOKE'
        if (!proc) { return def; } \
                            ^~~
    /wrkdirs/usr/ports/java/openjdk8/work/jdk8u-jdk8u352-b08.1/jdk/src/share/bin/splashscreen_stubs.c:68:28: error: incompatible pointer to integer conversion returning 'void *' from a function with result type 'int' [-Wint-conversion]
        INVOKE(SplashLoadFile, NULL)(filename);
                               ^~~~
    /usr/include/sys/_null.h:34:14: note: expanded from macro 'NULL'
    #define NULL    ((void *)0)
                    ^~~~~~~~~~~
    /wrkdirs/usr/ports/java/openjdk8/work/jdk8u-jdk8u352-b08.1/jdk/src/share/bin/splashscreen_stubs.c:60:39: note: expanded from macro 'INVOKE'
    #define INVOKE(name,def) _INVOKE(name,def,return)
                                          ^~~
    /wrkdirs/usr/ports/java/openjdk8/work/jdk8u-jdk8u352-b08.1/jdk/src/share/bin/splashscreen_stubs.c:57:25: note: expanded from macro '_INVOKE'
        if (!proc) { return def; } \
                            ^~~
    2 errors generated.

Indeed, instead of the pointer value NULL, the integer value 0 should be used.
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2022-12-07 14:57:54 UTC
Created attachment 238602 [details]
java/openjdk8: fix build with clang 15
Comment 2 Ed Maste freebsd_committer freebsd_triage 2022-12-07 19:05:07 UTC
Also fixed upstream as part of https://github.com/openjdk/jdk/commit/7b1455163ed893639059b3d62b71b2ff347c2e3f
Comment 3 commit-hook freebsd_committer freebsd_triage 2022-12-18 17:44:33 UTC
A commit in branch main references this bug:

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

commit d7146f6d335b360c5c9fb736cf49c7af939b77d7
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2022-12-07 14:53:48 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2022-12-18 17:23:58 +0000

    java/openjdk8: fix build with clang 15

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

        /wrkdirs/usr/ports/java/openjdk8/work/jdk8u-jdk8u352-b08.1/jdk/src/share/bin/splashscreen_stubs.c:64:30: error: incompatible pointer to integer conversion returning 'void *' from a function with result type 'int' [-Wint-conversion]
            INVOKE(SplashLoadMemory, NULL)(pdata, size);
                                     ^~~~
        /usr/include/sys/_null.h:34:14: note: expanded from macro 'NULL'
        #define NULL    ((void *)0)
                        ^~~~~~~~~~~
        /wrkdirs/usr/ports/java/openjdk8/work/jdk8u-jdk8u352-b08.1/jdk/src/share/bin/splashscreen_stubs.c:60:39: note: expanded from macro 'INVOKE'
        #define INVOKE(name,def) _INVOKE(name,def,return)
                                              ^~~
        /wrkdirs/usr/ports/java/openjdk8/work/jdk8u-jdk8u352-b08.1/jdk/src/share/bin/splashscreen_stubs.c:57:25: note: expanded from macro '_INVOKE'
            if (!proc) { return def; } \
                                ^~~
        /wrkdirs/usr/ports/java/openjdk8/work/jdk8u-jdk8u352-b08.1/jdk/src/share/bin/splashscreen_stubs.c:68:28: error: incompatible pointer to integer conversion returning 'void *' from a function with result type 'int' [-Wint-conversion]
            INVOKE(SplashLoadFile, NULL)(filename);
                                   ^~~~
        /usr/include/sys/_null.h:34:14: note: expanded from macro 'NULL'
        #define NULL    ((void *)0)
                        ^~~~~~~~~~~
        /wrkdirs/usr/ports/java/openjdk8/work/jdk8u-jdk8u352-b08.1/jdk/src/share/bin/splashscreen_stubs.c:60:39: note: expanded from macro 'INVOKE'
        #define INVOKE(name,def) _INVOKE(name,def,return)
                                              ^~~
        /wrkdirs/usr/ports/java/openjdk8/work/jdk8u-jdk8u352-b08.1/jdk/src/share/bin/splashscreen_stubs.c:57:25: note: expanded from macro '_INVOKE'
            if (!proc) { return def; } \
                                ^~~
        2 errors generated.

    Indeed, instead of the pointer value NULL, the integer value 0 should be
    used.

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

 .../patch-jdk_src_share_bin_splashscreen__stubs.c (new)  | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)