RFR 8009517: Disable fatal compiler warning in the old build

Brad Wetmore bradford.wetmore at oracle.com
Sat Mar 9 00:25:56 UTC 2013


I responded in another thread (wasn't aware of this one, sorry), there 
is an alternate to completely disabling -Werror.

On 3/8/2013 7:58 AM, Chris Hegarty wrote:
> On 08/03/2013 15:49, Mike Duigou wrote:
>> Looks fine to me.
>
> Thanks Mike.
>
>  > Do we have an issue open for restoring warnings to the new build?
>
> Not yet, that I am aware of. We really need the ability to set lint
> options per package/subpackage.

That would be nice.

I agree about warning creeping problems.  This is a temporary solution, 
we should soon be fixing the underlying hashcode/equals problems...but...

1.  javac tightened hashcode/equals checks

2.  new:  -Werror is off in the new builds.
     (i.e. not failing on any lint warnings)

3.  old:  -Werror is on for the old builds
     (i.e. is failing for any lint warnings)

The proposal is to turn off all errors in the old builds (remove 
-Werror), essentially making 3 like the 2.  Warn but not fatal.  We 
spent a lot of time cleaning up many directories, seems a shame to start 
allowing non-fatal warnings to come back into previously clean code 
because people aren't taking the time to fix new warnings as they are 
introduced.

My suggestion was to turn off just the one warning type in 3 *in the old 
code only* so we can at least continue to build the old without 
completely disabling -Werror.  The new builds will still warn, but the 
old builds will still fail for all but these override problems.  Yes, 
you lose the warnings in the old, but seems better than completely 
shutting off erroring.

(Ideally it would be nice to warn but not fail on just this one lint 
option, but don't see how that's possible.)

Brad





> -Chris.
>
>>
>> Mike
>>
>> On Mar 8 2013, at 05:24 , Chris Hegarty wrote:
>>
>>> Since the new build does not enable -Werror when compiling any java
>>> code, and disables quite a few lint options, new changes my
>>> inadvertently introduce warnings without even realizing. This can
>>> cause problems when building with the old build as many areas do
>>> compile with -Werror set. Since the old build is on life support,
>>> probably best to just completely disable -Werror, so anyone still
>>> needing to use it can.
>>>
>>> diff -r 48b7295f02f8 make/common/shared/Defs-java.gmk
>>> --- a/make/common/shared/Defs-java.gmk  Thu Mar 07 10:07:13 2013 +0000
>>> +++ b/make/common/shared/Defs-java.gmk  Thu Mar 07 11:10:37 2013 +0000
>>> @@ -122,9 +122,10 @@ ifeq ($(JAVAC_MAX_WARNINGS), true)
>>> ifeq ($(JAVAC_MAX_WARNINGS), true)
>>>    JAVAC_LINT_OPTIONS += -Xlint:all
>>> endif
>>> -ifeq ($(JAVAC_WARNINGS_FATAL), true)
>>> -  JAVACFLAGS  += -Werror
>>> -endif
>>> +# Disable fatal warnings, 8009517
>>> +#ifeq ($(JAVAC_WARNINGS_FATAL), true)
>>> +#  JAVACFLAGS  += -Werror
>>> +#endif
>>>
>>> # TODO: Workaround for CR 7063027. Remove -path eventually.
>>> JAVAC_LINT_OPTIONS += -Xlint:-path
>>>
>>> -Chris.
>>



More information about the build-dev mailing list