Xlint:unchecked

Erik Joelsson erik.joelsson at oracle.com
Fri Jan 31 08:03:00 UTC 2014


Unfortunately javac warnings aren't handled in a way that makes it easy 
to add or remove to them from the command line or configure. The -Xlint 
configuration for the main java compilation in the jdk is set in 
jdk/make/Setup.gmk:

# To build with all warnings enabled, do the following:
# make JAVAC_WARNINGS="-Xlint:all -Xmaxwarns 10000"
JAVAC_WARNINGS := 
-Xlint:-unchecked,-deprecation,-overrides,auxiliaryclass,cast,classfile,dep-ann,divzero,empty,overloads,static,try,varargs 
-Werror

Like the comment suggests, this variable may be overridden on the 
command line to make, but to enable a single extra warning type, you 
need to copy the current value and change it.

/Erik

On 2014-01-30 23:42, Pete Brunet wrote:
> Thanks Jon, I looked through the help output a couple of times and
> didn't find a way to specify javac args.  -Pete
>
> On 1/30/14 3:11 PM, Jonathan Gibbons wrote:
>> Pete,
>>
>> -Xlint is a javac arg, not a JVM arg, so setting
>>
>> --with-boot-jdk-jvmargs
>>
>> surely won't do anything.
>>
>> Use
>> sh ./configure.sh --help
>>
>> to see the full list of available options and env variables.
>>
>> -- Jon
>>
>> On 01/30/2014 12:40 PM, Pete Brunet wrote:
>>> Fixed typo in subject line...
>>>
>>> On 1/30/14 2:35 PM, Pete Brunet wrote:
>>>> I am getting these messages during a build:
>>>> Note: Some input files use unchecked or unsafe operations.
>>>> Note: Recompile with -Xlint:unchecked for details.
>>>>
>>>> So I tried redoing the config with
>>>> --with-boot-jdk-jvmargs="-Xlint:unchecked"
>>>> then touching the files and rebuilding but the build still used
>>>> -Xlint:-unchecked.
>>>>
>>>> Is there a way to compile with -Xlint:unchecked?
>>>>
>>>> Pete




More information about the build-dev mailing list