RFR: JDK-8211073 Remove -Wno-extra from Hotspot

Magnus Ihse Bursie magnus.ihse.bursie at oracle.com
Tue Oct 22 08:28:02 UTC 2019


On 2019-10-22 09:36, David Holmes wrote:
> Hi Magnus,
>
> On 22/10/2019 5:17 pm, Magnus Ihse Bursie wrote:
>> The -Wextra option to gcc enables a bunch of useful warnings. Some of 
>> them, but not all, can be individually enabled or disabled. All other 
>> libraries in OpenJDK are compiled with -Wextra, but not Hotspot. 
>> Enabling -Wextra triggers a couple of warnings that can be 
>> individually disabled. (The idea here is not to just permanently 
>> disable those warnings (unless that makes sense), but to look at 
>> these warnings one at a time and see how they can be addressed.)
>>
>> My trial runs with -Wextra has already found a couple of real issues 
>> (fixed in JDK-8213414).
>>
>> I have tested that this compiles without warnings on gcc 4.8, 5.5, 
>> 6.5, 7.4 and 8.3 on x64. I have also tried building zero on x64, 
>> aarch64 and arm32 with gcc 8.3.
>>
>> Bug: https://bugs.openjdk.java.net/browse/JDK-8211073
>> WebRev: 
>> http://cr.openjdk.java.net/~ihse/JDK-8211073-enable-extra-on-hotspot/webrev.01 
>
>
> I'm somewhat surprised that this isn't triggering more warnings, but 
> if not then that is a good thing. :) I wouldn't be surprised if gcc 
> 9.x causes something else pop up.
That is because I enabled it in a personal branch a long time ago, and 
have spent like the last year or so trying to fix the individual 
problems to prepare for this patch. ;-)

I wouldn't count on gcc 9 bringing in anything new to -Wextra. In 
general, gcc is *extremely* conservative about changing -Wextra 
nowadays. Virtually all new warnings that are added are added as 
indivudual warnings with explicit names to be turned on or turned off. 
Only after a long vetting process does any of these gets added to 
-Wextra. I think the last time anything was added to -Wextra was in like 
gcc 6..? So the -Wextra is in a way a bit of a legacy system in gcc for 
handling warnings.

/Magnus
>
> Fix seems fine.
>
> Thanks,
> David
>
>>
>> /Magnus




More information about the build-dev mailing list