RFR: 8307160: Fix AWT/2D/A11Y to support the permissive- flag on the Microsoft Visual C compiler [v45]

Magnus Ihse Bursie ihse at openjdk.org
Mon Dec 4 11:32:09 UTC 2023


On Mon, 4 Dec 2023 09:39:09 GMT, Julian Waters <jwaters at openjdk.org> wrote:

>> We should set the -permissive- flag for the Microsoft Visual C compiler, as was requested by the now backed out [JDK-8241499](https://bugs.openjdk.org/browse/JDK-8241499). Doing so makes the Visual C compiler much less accepting of ill formed code, which will improve code quality on Windows in the future.
>
> Julian Waters has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 78 commits:
> 
>  - Merge branch 'openjdk:master' into patch-10
>  - Fix awt_Window.cpp
>  - Fix awt_PrintJob.cpp
>  - -Zc:stringStrings no longer needed with -permissive- flags-cflags.m4
>  - Fix awt_Window.cpp
>  - awt_Window.cpp
>  - awt_PrintJob.cpp
>  - awt_Frame.cpp
>  - Whitespace awt_Component.cpp
>  - awt_Frame.cpp
>  - ... and 68 more: https://git.openjdk.org/jdk/compare/ed5b8c3a...fda1ab0f

make/autoconf/flags-cflags.m4 line 565:

> 563:     # The -utf-8 option sets source and execution character sets to UTF-8 to enable correct
> 564:     # compilation of all source files regardless of the active code page on Windows.
> 565:     TOOLCHAIN_CFLAGS_JVM="-nologo -MD -Zc:preprocessor -Zc:strictStrings -Zc:inline -permissive- -utf-8 -MP"

What is the rationale for removing `-Zc:strictStrings`? That seems like a step backwards. Also, this will affect *all* files compiled, both hotspot and all native JDK libraries.

If there is a single file that cannot (for some reason) be fixed to have the compiler stop complaining about const strings, that individual file should have `-Zc:strictStrings-` added to its CFLAGS.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/15096#discussion_r1413741134


More information about the build-dev mailing list