RFR: 8352612: No way to add back lint categories after "none" [v4]

Maurizio Cimadamore mcimadamore at openjdk.org
Thu Apr 10 18:33:29 UTC 2025


On Thu, 10 Apr 2025 16:33:09 GMT, Archie Cobbs <acobbs at openjdk.org> wrote:

>> This PR relates to the `-Xlint:none` flag. Currently, it not only disables all lint categories as one would expect, but it also disables all non-mandatory warnings, period. In other words, `-Xlint:none` has `-nowarn` as a hidden side-effect. So for example, trying to do `-Xlint:none,serial` to enable only the `serial` lint category is futile: the category will be enabled but the warnings won't ever appear. This PR removes that hidden side-effect, and also clarifies some of the help output.
>
> Archie Cobbs has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Tweak wording changes and sync to man page per review suggestions.

src/jdk.compiler/share/man/javac.md line 564:

> 562: 
> 563: <a id="option-Xlint-custom">`-Xlint:`\[`-`\]*key*(`,`\[`-`\]*key*)\*</a>
> 564: :   Specifies warning categories to enable or disable, separated by comma.

This text uses `categories` and `key` in a very loose way -- they seem to refer to the same concept, yet none seems to be defined.


Enables or disables selected warning categories. Each warning category is identified by a key. Some keys allow multiple categories to be enabled or disabled in bulk. Keys are separated by a comma. Precede a key by a hyphen (-) to disable the corresponding warning category.

Supported keys are:
...


What do you think?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24227#discussion_r2038023951


More information about the compiler-dev mailing list