RFR: 8302838: jabswitch main() should avoid calling exit explicitly

Julian Waters jwaters at openjdk.org
Mon Feb 20 08:17:12 UTC 2023


In jabswitch, main is defined as `void main()`, which requires an explicit exit call whenever an error occurs, and extra error checking code on our part. Visual C++ will automatically convert all instances of `void main()` to return 0 in all cases anyway, and there isn't anything gained from using this custom signature when the same can be achieved by simply returning the error value normally, so I propose we simply change it to the regular `int main` signature

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

Commit messages:
 - jabswitch.cpp

Changes: https://git.openjdk.org/jdk/pull/12650/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=12650&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8302838
  Stats: 6 lines in 1 file changed: 1 ins; 4 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/12650.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/12650/head:pull/12650

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



More information about the client-libs-dev mailing list