RFR: 8339156: Use more fine-granular clang unused warnings

Magnus Ihse Bursie ihse at openjdk.org
Fri Aug 30 11:35:51 UTC 2024


On Thu, 29 Aug 2024 13:14:35 GMT, Magnus Ihse Bursie <ihse at openjdk.org> wrote:

> Currently, we issue -Wno-unused for all files in clang, which is a rather big sledgehammer to get rid of some warnings that proliferate in a few areas of the build.
> 
> We should instead leave -Wunused turned on (as done by -Wall) and use a much more fine-grained approach to disabling specific warnings in specific files or libraries.
> 
> This is similar to what has been done for gcc in JDK-8339120.

As Kim says. I can pave the way for the component teams to fix the warnings as smoothly as possible, but I cannot and will not try to fix the actual issue. (When I embarked on the journey to try and improve the warning situation, I naïvely tried to fix some "simple" warnings, thinking that would be easier than to turn off the warning... Heh! Just let me say, I'm not doing that again.)

I used to file a JBS issue whenever I disabled a warning on a component, but they were mostly just ignored or closed after several years without any action, so I got tired of doing all the paperwork for nothing.

Maybe we can try to raise some general awareness that teams should check up what warnings they have disabled and see if they can fix them? I know some teams, like client-libs, have tons of warnings, are well aware of the fact, but do not have the manpower to be able to address them. Other teams might just be oblivious to the situations, however, but I have no way to tell which way it is.

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

PR Comment: https://git.openjdk.org/jdk/pull/20770#issuecomment-2320924437


More information about the core-libs-dev mailing list