[jdk8u-dev] RFR: 8315506: C99 compatibility issue in LinuxNativeDispatcher

Andrew John Hughes andrew at openjdk.org
Fri Sep 1 15:52:48 UTC 2023


On Fri, 1 Sep 2023 15:34:24 GMT, Florian Weimer <fweimer at openjdk.org> wrote:

> > Out of interest, what flags are you building with to make this a build failure? I've not seen that when building 8u. I don't believe this code is built with `-Werror` by default.
> 
> @gnu-andrew This was originally detected with an instrumented compilers that treats such issues errors, and logs them so that build scripts have a hard time suppressing errors (relevant to configure scripts).
> 

Ah, that explains why I haven't seen it. I have built with some newer GCCs and even have a PR in flight to get GCC 11 working (https://github.com/openjdk/jdk8u-dev/pull/357 - still  need to work out why that is failing on cross-compile)

> Current Clang defaults `-Werror=implict-function-declaration`, so no special build flags are necessary there to trigger this issue (but I haven't tried building OpenJDK with Clang). For quite some time, expected GCC 14 to something like this as well, but I'm not sure if things will work out.
> 

I think later JDK versions should support Clang, but probably not 8u. I did have backporting support on a long TODO list at one point, but it's probably not worth it at this stage. That said, the situation might be better due to the MacOS support that's been added since, making Linux Clang support less problematic.

If we did support it, we'd probably need to add a build-only run with Clang to GHA.

> Speaking of flags, I plan to add `-Werror=implict-function-declaration -Werror=implicit-int` to the default flags in Fedora. Should I backport this change proactively to the `java-1.8.0-openjdk-portable`?

Do you mean this change or the additional flags? I thought this change was already in there.

There is a `-Wno-error` added in the Fedora build which I expect may cancel this out even if the flags you suggest are added. `-Werror=implicit-function-declaration` is certainly a useful one to have and one I ran with myself locally for a while. But fixing stuff like that in a JDK as old as 8u might be problematic and I'd certainly start with `java-21-openjdk` first.

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

PR Comment: https://git.openjdk.org/jdk8u-dev/pull/362#issuecomment-1702962197


More information about the jdk8u-dev mailing list