RFR: 8294314: Minimize disabled warnings in hotspot [v18]
Magnus Ihse Bursie
ihse at openjdk.org
Wed Oct 12 10:45:26 UTC 2022
> After [JDK-8294281](https://bugs.openjdk.org/browse/JDK-8294281), it is now possible to disable warnings for individual files instead for whole libraries. I used this opportunity to go through all disabled warnings in hotspot.
>
> Any warnings that were only triggered in a few files were removed from hotspot as a whole, and changed to be only disabled for those files.
>
> Some warnings didn't trigger in any file anymore, and could just be removed.
>
> Overall, this reduced the number of disabled warnings by roughly half for gcc, clang and visual studio. The remaining warnings are sorted in "frequency", that is, the first listed warnings are triggered in the most number of files, while the last in the fewest number of files. So if anyone were to try to address the remaining warnings, it would make sense to chop of this list from the back.
>
> I believe the warnings that are disabled on a per-file basis can most likely be fixed relatively easily.
>
> I have verified this by Oracle's internal CI system, and GitHub Actions. (But I have not yet gotten a fully green run due to instabilities in GHA, however this patch can't reasonably have anything to do with that.) As always, warnings tend to differ a bit between compilers, so if someone wants to take this on a spin with some other version, please go ahead. If I missed some warning, in worst case we'll just have to add it back again, and in the meanwhile `configure --disable-warnings-as-errors` is an okay workaround.
>
> It also turned out that JDK-8294281 did not save the new per-file warnings in VarDeps, so I had to move $1_WARNINGS_FLAGS from $1_BASE_CFLAGS to $1_CFLAGS (and similar for C++).
>
> Annoyingly, the assert macro triggers `tautological-constant-out-of-range-compare` on clang, so while this is a single problem in a single file, this erupts all over the place in debug builds. If this can be fixed, the ugly extra `DISABLED_WARNINGS_clang += tautological-constant-out-of-range-compare` for non-release builds can be removed.
Magnus Ihse Bursie has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 29 additional commits since the last revision:
- Merge branch 'master' into hotspot-warnings-per-file
- Revert jvm variants hack
- Revert "TESTING GHA v2: Previous attempt was botched"
This reverts commit 4a51a15cd73ebc6aa96ad04f9b1eb88e2683c82f.
- Add missing sub workflow inputs
- Pass additional arguments to GHA runs
- TESTING GHA v2: Previous attempt was botched
- TESTING: enable all variants
- add address for cgroupV1Subsystem_linux.cpp (thanks @shqking)
Co-authored-by: Hao Sun <hao.sun at arm.com>
- Add misleading-indentation for client (thanks @shqking)
Co-authored-by: Hao Sun <hao.sun at arm.com>
- Don't need empty-body for ad_ppc.cpp now that it is globally disabled
- ... and 19 more: https://git.openjdk.org/jdk/compare/21647a39...f4f65396
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/10414/files
- new: https://git.openjdk.org/jdk/pull/10414/files/d6c52a2a..f4f65396
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=10414&range=17
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=10414&range=16-17
Stats: 27023 lines in 667 files changed: 16269 ins; 7621 del; 3133 mod
Patch: https://git.openjdk.org/jdk/pull/10414.diff
Fetch: git fetch https://git.openjdk.org/jdk pull/10414/head:pull/10414
PR: https://git.openjdk.org/jdk/pull/10414
More information about the build-dev
mailing list