RFR: 8030350: Enable additional compiler warnings for GCC (original) (raw)

Lois Foltan lois.foltan at oracle.com
Wed Dec 18 15:03:49 UTC 2013


Hi Mike,

We need to be careful that these options are also supported on MacOS with the clang compiler in case there is a future migration to clang for JDK 9 or higher.

Thanks, Lois

On 12/17/2013 7:08 PM, Mike Duigou wrote:

Hello all;

This is a change which enables additional compiler warnings for native compilation when using GCC. The (-Wformat -Wformat-security) options are supported by GCC 3.0.4 (the earliest version I checked, c. February 2002) and later so we shouldn't see issues with incompatibility.- Wextra appears to have been added in GCC 3.4.X line (c. 2004) so it should also be reasonably well adopted and replaces -W. The core of the change is to add : -Wextra -Wno-unused-parameter -Wformat -Wformat-security for general C and CC++ compilations. For HotSpot C++ compiles a slightly less aggressive set is used: -Wformat -Wformat-security is used. Webrev here: http://cr.openjdk.java.net/~mduigou/JDK-8030350/0/webrev/ For the curious, yes, the additional checks do generate additional warnings. ;-) This change is targeted at the JDK 9 repos but could be backported to JDK 8 fairly easily/safely. Mike



More information about the build-dev mailing list