Build portability: enable or disable warnings
Dr Andrew John Hughes
ahughes at redhat.com
Thu May 19 20:28:27 UTC 2011
On 10:32 Thu 19 May , Alan Bateman wrote:
> David Holmes wrote:
> > :
> >
> >> In contrast, there are basically two Java compilers in general use
> >> (javac and ecj)
> >> and one is part of OpenJDK. Yet, the Java code does not have -Werror
> >> enabled by default and there
> >> are a mass of warnings there as a result.
> >
> > I don't understand the point you are making here. Does javac even have
> > a -Werror? The bulk of javac warnings stem from legacy code being
> > compiled under newer compilers with new language features - the
> > resulting code is not erroneous hence only a warning is issued.
> >
> > I think comparing C/C++ compiler warnings with javac compiler warnings
> > is like comparing apples and elephants.
> Yes, javac has -Werror and the build has JAVAC_WARNINGS_FATAL to turn it
> on. I just checked my recent build of the jdk7/jdk7 forest and javac
> emits a total of 9 warnings (7 are unsafe usages of varargs methods and
> the other two are unreachable catch clauses). That isn't a lot but javac
> doesn't have many warnings enabled by default. A nice project for
> someone would be to change the build to -Werror by default and gradually
> crank up the warnings listed by -Xlint.
>
javac is generally a good citizen. I was thinking of jdk code.
I have built with JAVAC_MAX_WARNINGS=true on a number of occasions and
it's only recently (thanks to a few fixes from myself) that it's
actually been able to complete the build, due to some Makefiles
turning on Werror separately. I expect with JAVAC_WARNINGS_FATAL as
well we wouldn't get past CORBA.
I do think having a switch to turn on everything but serial and deprecated
warnings would be a more achievable goal, and would help get rid of
the remaining 1.5 stuff.
> -Alan.
>
>
--
Andrew :)
Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)
Support Free Java!
Contribute to GNU Classpath and IcedTea
http://www.gnu.org/software/classpath
http://icedtea.classpath.org
PGP Key: F5862A37 (https://keys.indymedia.org/)
Fingerprint = EA30 D855 D50F 90CD F54D 0698 0713 C3ED F586 2A37
More information about the build-dev
mailing list