RFR: 8289768: Clean up unused code

Daniel Jeliński djelinski at openjdk.org
Tue Jul 5 21:06:58 UTC 2022


This patch removes many unused variables and one unused label reported by the compilers when relevant warnings are enabled. 

The unused code was found by compiling after removing `unused` from the list of disabled warnings for [gcc](https://github.com/openjdk/jdk/blob/master/make/autoconf/flags-cflags.m4#L190) and [clang](https://github.com/openjdk/jdk/blob/master/make/autoconf/flags-cflags.m4#L203), and enabling [C4189](https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4189?view=msvc-170) MSVC warning.

I only removed variables that were uninitialized or initialized without side effects. I verified that the removed variables were not used in any `#ifdef`'d code. I checked that the changed code still compiles on Windows, Linux and Mac, both in release and debug versions.

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

Commit messages:
 - Remove unused variables (windows)
 - Remove unused variables (macos)
 - Remove unused variables (linux)

Changes: https://git.openjdk.org/jdk/pull/9383/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=9383&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8289768
  Stats: 69 lines in 45 files changed: 0 ins; 65 del; 4 mod
  Patch: https://git.openjdk.org/jdk/pull/9383.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/9383/head:pull/9383

PR: https://git.openjdk.org/jdk/pull/9383


More information about the serviceability-dev mailing list