Re: RFR: 8325163: Enable -Wpedantic on clang [v2]

2024-04-15 Thread Magnus Ihse Bursie
On Mon, 5 Feb 2024 10:58:17 GMT, Magnus Ihse Bursie wrote: >> Inspired by (the later backed-out) >> [JDK-8296115](https://bugs.openjdk.org/browse/JDK-8296115), I propose to >> enable `-Wpedantic` for clang. This has already found some irregularities in >> the code, like mistakenly using

Re: RFR: 8325163: Enable -Wpedantic on clang [v2]

2024-03-16 Thread Magnus Ihse Bursie
On Mon, 5 Feb 2024 10:58:17 GMT, Magnus Ihse Bursie wrote: >> Inspired by (the later backed-out) >> [JDK-8296115](https://bugs.openjdk.org/browse/JDK-8296115), I propose to >> enable `-Wpedantic` for clang. This has already found some irregularities in >> the code, like mistakenly using

Re: RFR: 8325163: Enable -Wpedantic on clang [v2]

2024-02-16 Thread Phil Race
On Mon, 5 Feb 2024 10:58:17 GMT, Magnus Ihse Bursie wrote: >> Inspired by (the later backed-out) >> [JDK-8296115](https://bugs.openjdk.org/browse/JDK-8296115), I propose to >> enable `-Wpedantic` for clang. This has already found some irregularities in >> the code, like mistakenly using

Re: RFR: 8325163: Enable -Wpedantic on clang [v2]

2024-02-16 Thread Kim Barrett
On Mon, 5 Feb 2024 21:39:06 GMT, Magnus Ihse Bursie wrote: > Here is the full list: > https://clang.llvm.org/docs/DiagnosticsReference.html#wpedantic I know about that list, and that's not what I was asking for. I want to understand the impact on *our* code. What warnings are arising from

Re: RFR: 8325163: Enable -Wpedantic on clang [v2]

2024-02-05 Thread David Holmes
On Mon, 5 Feb 2024 10:58:17 GMT, Magnus Ihse Bursie wrote: >> Inspired by (the later backed-out) >> [JDK-8296115](https://bugs.openjdk.org/browse/JDK-8296115), I propose to >> enable `-Wpedantic` for clang. This has already found some irregularities in >> the code, like mistakenly using

Re: RFR: 8325163: Enable -Wpedantic on clang

2024-02-05 Thread David Holmes
On Mon, 5 Feb 2024 15:42:40 GMT, Kim Barrett wrote: > I thought we didn't, because we were instead supposed to use INTPTR_FORMAT and the (currently?) equivalent PTR_FORMAT. Those macros aren't legacy, they are to provide consistent output across platforms. "%p" provides implementation defined

Re: RFR: 8325163: Enable -Wpedantic on clang [v2]

2024-02-05 Thread Kim Barrett
On Mon, 5 Feb 2024 16:19:59 GMT, Magnus Ihse Bursie wrote: > Is there anything in this proposed PR that you gentlemen disagree with or > object to? Or is this fine to push as a step in our ongoing pursuit of > increasing the code quality, that can (and will) be followed by many more? Yes. As

Re: RFR: 8325163: Enable -Wpedantic on clang [v2]

2024-02-05 Thread Magnus Ihse Bursie
On Mon, 5 Feb 2024 10:58:17 GMT, Magnus Ihse Bursie wrote: >> Inspired by (the later backed-out) >> [JDK-8296115](https://bugs.openjdk.org/browse/JDK-8296115), I propose to >> enable `-Wpedantic` for clang. This has already found some irregularities in >> the code, like mistakenly using

Re: RFR: 8325163: Enable -Wpedantic on clang [v2]

2024-02-05 Thread Julian Waters
On Mon, 5 Feb 2024 10:58:17 GMT, Magnus Ihse Bursie wrote: >> Inspired by (the later backed-out) >> [JDK-8296115](https://bugs.openjdk.org/browse/JDK-8296115), I propose to >> enable `-Wpedantic` for clang. This has already found some irregularities in >> the code, like mistakenly using

Re: RFR: 8325163: Enable -Wpedantic on clang [v2]

2024-02-05 Thread Magnus Ihse Bursie
On Mon, 5 Feb 2024 10:58:17 GMT, Magnus Ihse Bursie wrote: >> Inspired by (the later backed-out) >> [JDK-8296115](https://bugs.openjdk.org/browse/JDK-8296115), I propose to >> enable `-Wpedantic` for clang. This has already found some irregularities in >> the code, like mistakenly using

Re: RFR: 8325163: Enable -Wpedantic on clang [v2]

2024-02-05 Thread Julian Waters
On Mon, 5 Feb 2024 10:58:17 GMT, Magnus Ihse Bursie wrote: >> Inspired by (the later backed-out) >> [JDK-8296115](https://bugs.openjdk.org/browse/JDK-8296115), I propose to >> enable `-Wpedantic` for clang. This has already found some irregularities in >> the code, like mistakenly using

Re: RFR: 8325163: Enable -Wpedantic on clang

2024-02-05 Thread Kim Barrett
On Mon, 5 Feb 2024 15:42:40 GMT, Kim Barrett wrote: >>> I consider the "format '%p' expects argument of type 'void*" warnings to be >>> not at all helpful. Fortunately we don't use '%p' in HotSpot, >> >> We do use it in hotspot. Not a huge amount as we have the legacy format >> specifiers for

Re: RFR: 8325163: Enable -Wpedantic on clang

2024-02-05 Thread Kim Barrett
On Mon, 5 Feb 2024 06:15:08 GMT, David Holmes wrote: > > I consider the "format '%p' expects argument of type 'void*" warnings to be > > not at all helpful. Fortunately we don't use '%p' in HotSpot, > > We do use it in hotspot. Not a huge amount as we have the legacy format > specifiers for

Re: RFR: 8325163: Enable -Wpedantic on clang

2024-02-05 Thread Kim Barrett
> On Feb 5, 2024, at 4:31 AM, Magnus Ihse Bursie wrote: > > On Mon, 5 Feb 2024 03:21:35 GMT, Kim Barrett wrote: > >>> Inspired by (the later backed-out) >>> [JDK-8296115](https://bugs.openjdk.org/browse/JDK-8296115), I propose to >>> enable `-Wpedantic` for clang. This has already found some

Re: RFR: 8325163: Enable -Wpedantic on clang

2024-02-05 Thread Kim Barrett
On Mon, 5 Feb 2024 03:21:35 GMT, Kim Barrett wrote: >> Inspired by (the later backed-out) >> [JDK-8296115](https://bugs.openjdk.org/browse/JDK-8296115), I propose to >> enable `-Wpedantic` for clang. This has already found some irregularities in >> the code, like mistakenly using `#import`

Re: RFR: 8325163: Enable -Wpedantic on clang [v2]

2024-02-05 Thread Magnus Ihse Bursie
On Mon, 5 Feb 2024 10:58:17 GMT, Magnus Ihse Bursie wrote: >> Inspired by (the later backed-out) >> [JDK-8296115](https://bugs.openjdk.org/browse/JDK-8296115), I propose to >> enable `-Wpedantic` for clang. This has already found some irregularities in >> the code, like mistakenly using

Re: RFR: 8325163: Enable -Wpedantic on clang [v2]

2024-02-05 Thread Julian Waters
On Mon, 5 Feb 2024 10:58:17 GMT, Magnus Ihse Bursie wrote: >> Inspired by (the later backed-out) >> [JDK-8296115](https://bugs.openjdk.org/browse/JDK-8296115), I propose to >> enable `-Wpedantic` for clang. This has already found some irregularities in >> the code, like mistakenly using

Re: RFR: 8325163: Enable -Wpedantic on clang

2024-02-05 Thread Julian Waters
On Mon, 5 Feb 2024 12:15:50 GMT, Magnus Ihse Bursie 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

Re: RFR: 8325163: Enable -Wpedantic on clang

2024-02-05 Thread Magnus Ihse Bursie
On Mon, 5 Feb 2024 10:49:07 GMT, Julian Waters wrote: > The other concern I had was that there are a ton of disabled warnings added > by this change, but I guess that's already been answered by that other reply Just to be clear: these warnings have never been turned on. They are implicitly

Re: RFR: 8325163: Enable -Wpedantic on clang

2024-02-05 Thread Magnus Ihse Bursie
On Mon, 5 Feb 2024 10:49:07 GMT, Julian Waters 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

Re: RFR: 8325163: Enable -Wpedantic on clang [v2]

2024-02-05 Thread Magnus Ihse Bursie
> Inspired by (the later backed-out) > [JDK-8296115](https://bugs.openjdk.org/browse/JDK-8296115), I propose to > enable `-Wpedantic` for clang. This has already found some irregularities in > the code, like mistakenly using `#import` instead of `#include`. In this > patch, I disable warnings

Re: RFR: 8325163: Enable -Wpedantic on clang

2024-02-05 Thread Julian Waters
On Mon, 5 Feb 2024 10:44:59 GMT, Magnus Ihse Bursie wrote: > I am sorry, but all I can see is: > > > Just a few questions... > > and then your comment ends. And I can't find any other comment with a list of > questions. Eh? Aren't they in the code review section? But in any case: >

Re: RFR: 8325163: Enable -Wpedantic on clang

2024-02-05 Thread Magnus Ihse Bursie
On Fri, 2 Feb 2024 15:22:03 GMT, Magnus Ihse Bursie wrote: > Inspired by (the later backed-out) > [JDK-8296115](https://bugs.openjdk.org/browse/JDK-8296115), I propose to > enable `-Wpedantic` for clang. This has already found some irregularities in > the code, like mistakenly using `#import`

Re: RFR: 8325163: Enable -Wpedantic on clang

2024-02-05 Thread Julian Waters
On Mon, 5 Feb 2024 09:32:09 GMT, Magnus Ihse Bursie wrote: > > at least not for a future version applying to gcc builds. > > @kimbarrett @TheShermanTanker Please do not drag gcc into this PR. This is > just about clang. Unless gcc makes a serious effort to shape up their > inferior warning

Re: RFR: 8325163: Enable -Wpedantic on clang

2024-02-05 Thread Magnus Ihse Bursie
On Fri, 2 Feb 2024 15:22:03 GMT, Magnus Ihse Bursie wrote: > Inspired by (the later backed-out) > [JDK-8296115](https://bugs.openjdk.org/browse/JDK-8296115), I propose to > enable `-Wpedantic` for clang. This has already found some irregularities in > the code, like mistakenly using `#import`

Re: RFR: 8325163: Enable -Wpedantic on clang

2024-02-05 Thread Magnus Ihse Bursie
On Mon, 5 Feb 2024 03:07:43 GMT, Kim Barrett wrote: > at least not for a future version applying to gcc builds. @kimbarrett @TheShermanTanker Please do not drag gcc into this PR. This is just about clang. Unless gcc makes a serious effort to shape up their inferior warning handling, I don't

Re: RFR: 8325163: Enable -Wpedantic on clang

2024-02-05 Thread Magnus Ihse Bursie
On Mon, 5 Feb 2024 03:21:35 GMT, Kim Barrett wrote: >> Inspired by (the later backed-out) >> [JDK-8296115](https://bugs.openjdk.org/browse/JDK-8296115), I propose to >> enable `-Wpedantic` for clang. This has already found some irregularities in >> the code, like mistakenly using `#import`

Re: RFR: 8325163: Enable -Wpedantic on clang

2024-02-04 Thread Julian Waters
On Mon, 5 Feb 2024 03:21:35 GMT, Kim Barrett wrote: >> Inspired by (the later backed-out) >> [JDK-8296115](https://bugs.openjdk.org/browse/JDK-8296115), I propose to >> enable `-Wpedantic` for clang. This has already found some irregularities in >> the code, like mistakenly using `#import`

Re: RFR: 8325163: Enable -Wpedantic on clang

2024-02-04 Thread Julian Waters
On Fri, 2 Feb 2024 15:22:03 GMT, Magnus Ihse Bursie wrote: > Inspired by (the later backed-out) > [JDK-8296115](https://bugs.openjdk.org/browse/JDK-8296115), I propose to > enable `-Wpedantic` for clang. This has already found some irregularities in > the code, like mistakenly using `#import`

Re: RFR: 8325163: Enable -Wpedantic on clang

2024-02-04 Thread Julian Waters
On Sun, 4 Feb 2024 22:52:19 GMT, Magnus Ihse Bursie wrote: > > Guess I could work on the gcc counterpart and find a way around the > > inability to disable -Wpedantic with it in tandem with this change... > > I don't think that is possible. The double semicolon rule can only be > disabled by

Re: RFR: 8325163: Enable -Wpedantic on clang

2024-02-04 Thread David Holmes
On Mon, 5 Feb 2024 03:07:43 GMT, Kim Barrett wrote: > I consider the "format '%p' expects argument of type 'void*" warnings to be > not at all helpful. Fortunately we don't use '%p' in HotSpot, We do use it in hotspot. Not a huge amount as we have the legacy format specifiers for PTR_FORMAT

Re: RFR: 8325163: Enable -Wpedantic on clang

2024-02-04 Thread Kim Barrett
On Fri, 2 Feb 2024 15:22:03 GMT, Magnus Ihse Bursie wrote: > Inspired by (the later backed-out) > [JDK-8296115](https://bugs.openjdk.org/browse/JDK-8296115), I propose to > enable `-Wpedantic` for clang. This has already found some irregularities in > the code, like mistakenly using `#import`

Re: RFR: 8325163: Enable -Wpedantic on clang

2024-02-04 Thread Kim Barrett
On Fri, 2 Feb 2024 15:22:03 GMT, Magnus Ihse Bursie wrote: > #define DEBUG_ONLY(code) code; > > DEBUG_ONLY(foo()); > ``` > > will result in a `; ;`. This breaks the C standard, but is benign, and we use > it all over the place. On clang, we can ignore this by `-Wno-extra-semi`, but > this is

Re: RFR: 8325163: Enable -Wpedantic on clang

2024-02-04 Thread Magnus Ihse Bursie
On Fri, 2 Feb 2024 15:59:56 GMT, Julian Waters wrote: > Guess I could work on the gcc counterpart and find a way around the inability > to disable -Wpedantic with it in tandem with this change... I don't think that is possible. The double semicolon rule can only be disabled by disabling

Re: RFR: 8325163: Enable -Wpedantic on clang

2024-02-04 Thread Magnus Ihse Bursie
On Fri, 2 Feb 2024 15:22:03 GMT, Magnus Ihse Bursie wrote: > Inspired by (the later backed-out) > [JDK-8296115](https://bugs.openjdk.org/browse/JDK-8296115), I propose to > enable `-Wpedantic` for clang. This has already found some irregularities in > the code, like mistakenly using `#import`

Re: RFR: 8325163: Enable -Wpedantic on clang

2024-02-02 Thread Erik Joelsson
On Fri, 2 Feb 2024 15:22:03 GMT, Magnus Ihse Bursie wrote: > Inspired by (the later backed-out) > [JDK-8296115](https://bugs.openjdk.org/browse/JDK-8296115), I propose to > enable `-Wpedantic` for clang. This has already found some irregularities in > the code, like mistakenly using `#import`

Re: RFR: 8325163: Enable -Wpedantic on clang

2024-02-02 Thread Julian Waters
On Fri, 2 Feb 2024 15:22:03 GMT, Magnus Ihse Bursie wrote: > Inspired by (the later backed-out) > [JDK-8296115](https://bugs.openjdk.org/browse/JDK-8296115), I propose to > enable `-Wpedantic` for clang. This has already found some irregularities in > the code, like mistakenly using `#import`

Re: RFR: 8325163: Enable -Wpedantic on clang

2024-02-02 Thread Julian Waters
On Fri, 2 Feb 2024 15:22:03 GMT, Magnus Ihse Bursie wrote: > Inspired by (the later backed-out) > [JDK-8296115](https://bugs.openjdk.org/browse/JDK-8296115), I propose to > enable `-Wpedantic` for clang. This has already found some irregularities in > the code, like mistakenly using `#import`

RFR: 8325163: Enable -Wpedantic on clang

2024-02-02 Thread Magnus Ihse Bursie
Inspired by (the later backed-out) [JDK-8296115](https://bugs.openjdk.org/browse/JDK-8296115), I propose to enable `-Wpedantic` for clang. This has already found some irregularities in the code, like mistakenly using `#import` instead of `#include`. In this patch, I disable warnings for these