RFR: 8325163: Enable -Wpedantic on clang

Julian Waters jwaters at openjdk.org
Mon Feb 5 12:51:06 UTC 2024


On Mon, 5 Feb 2024 12:15:50 GMT, Magnus Ihse Bursie <ihse at openjdk.org> wrote:

> > Shouldn't this be -pedantic -Wpedantic, and wouldn't this be better positioned at where HotSpot currently sets -permissive- for Microsoft Visual C++ (In other words, TOOLCHAIN_CFLAGS_JVM and TOOLCHAIN_CFLAGS_JDK)? The 2 options are not the same, at least on gcc, and I'm unsure if the same is true for clang
> 
> (It is really weird, I cannot find that original comment anywhere in the Github PR :-()
> 
> As far as I have been able to determine, -Wpedantic and -pedantic are aliases on gcc > 5, and the same is true for clang. -Wpedantic seems to be the preferred way nowadays.
> 
> `TOOLCHAIN_CFLAGS_JVM` is arguably if not wrong so at least not the best place to put `-permissive-`. `-Wpermissive` belongs with `-Wall -Wextra`.

TOOLCHAIN_CFLAGS_JVM and TOOLCHAIN_CFLAGS_JDK have, until now, been where the -Zc: conformance options are passed, which is why I recommended adding them there, to match what Visual C++ does at the moment. Maybe I have it the other way around, and it is Visual C++ that needs to be changed to match clang (Both for permissive- and -Zc: options)

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

PR Comment: https://git.openjdk.org/jdk/pull/17687#issuecomment-1926925644


More information about the client-libs-dev mailing list