How to add options to the javac build in the JDK 8 repo?

Joe Darcy joe.darcy at oracle.com
Thu Sep 5 17:53:54 UTC 2013


Hi Magnus,

On 9/5/2013 2:01 AM, Magnus Ihse Bursie wrote:
> Hi Joe,
>
> First of all, I think what you're doing is a great job, and I'm all in 
> favor of enabling more warnings!

Thanks; I'm all for more warnings too :-)

>
>>  DISABLE_WARNINGS:=-Xlint:all,-deprecation,-unchecked,-rawtypes,-cast,-serial,-dep-ann,-static,-fallthrough,-try,-varargs,-empty,-finally 
>>
>> +JAVAC_WARNINGS:=-Xlint:-unchecked,-deprecation,-overrides,auxiliaryclass,classfile,dep-ann,divzero,empty,try,varargs 
>> -Werror
>
> Would you mind elaborating a bit on the choice to remove the "all" and 
> replace it with a specified list of warnings? From my point of view, 
> having "all" turned on, and specific warnings turned off seems like an 
> approach that minimizes the risk that someone inadvertently adds code 
> that will cause an warning of a type that is currently not 
> specifically listed.

My longer term goal is to build the JDK sources successfully under 
-Xlint:all. Given how the build currently works, it is easier to expand 
the set of warnings by clearing a category of error at a time (rather 
than completely cleaning, say, a package of code).

Once the "foo" category of warnings are resolved, I think it is a bit 
clearer to add "foo," to the list of enabled lint warnings rather than 
to remove "-foo,".

However, I'm less concerned with how the various Xlint checks are 
enabled compared to getting them enabled.

Thanks,

-Joe

>
> If having "all" turned on results in warnings that breaks the build 
> due to -Werror, these warnings should be explicitely disabled in the 
> Xlint options as well.
>
> Is it the case that Xlint:all is a misnomer, just like the GCC -Wall, 
> which does in fact not at all turn on all warnings? According to the 
> documentation, Xlint:all turns on all "recommended" warnings, but I 
> can't find any specification of what those "recommended" warnings are. 
> But even if this is the case, it would not hurt to keep the "all" and 
> add the additional warnings that we want enabled, would it?
>
> /Magnus




More information about the build-dev mailing list