Re: Build portability: enable or disable warnings

2011-05-20 Thread Jonathan Gibbons
On 05/20/2011 06:57 AM, Dr Andrew John Hughes wrote: I did find it worrying that there was an active desire to use new OpenJDK7 language features throughout the codebase (despite the bootstrapping problems this can cause), yet these 1.5 issues remain. Speaking just to the bootstrapping proble

Re: Build portability: enable or disable warnings

2011-05-20 Thread Andrew Haley
On 05/20/2011 02:57 PM, Dr Andrew John Hughes wrote: > > I did find it worrying that there was an active desire to use new > OpenJDK7 language features throughout the codebase (despite the > bootstrapping problems this can cause), yet these 1.5 issues remain. I'd be a bit more worried for the hea

Re: Build portability: enable or disable warnings

2011-05-20 Thread Dr Andrew John Hughes
On 07:20 Fri 20 May , David Holmes wrote: > Dr Andrew John Hughes said the following on 05/20/11 06:24: > > On 09:47 Thu 19 May , David Holmes wrote: > >> Dr Andrew John Hughes said the following on 05/19/11 05:29: > >>> On 08:35 Mon 16 May , Kelly O'Hair wrote: > >> > The -Werror

Re: Build portability: enable or disable warnings

2011-05-19 Thread David Holmes
Jonathan Gibbons said the following on 05/20/11 09:39: On 05/19/2011 02:20 PM, David Holmes wrote: javac produces new warnings because new language features cause new potential issues. David, FYI, javac has more warnings than you describe. For example, -Xlint:fallthrough warns about fall

Re: Build portability: enable or disable warnings

2011-05-19 Thread Jonathan Gibbons
On 05/19/2011 02:20 PM, David Holmes wrote: javac produces new warnings because new language features cause new potential issues. David, FYI, javac has more warnings than you describe. For example, -Xlint:fallthrough warns about falling from one case in a switch statement into another. T

Re: Build portability: enable or disable warnings

2011-05-19 Thread David Holmes
Dr Andrew John Hughes said the following on 05/20/11 06:24: On 09:47 Thu 19 May , David Holmes wrote: Dr Andrew John Hughes said the following on 05/19/11 05:29: On 08:35 Mon 16 May , Kelly O'Hair wrote: The -Werror option is a blessing and a curse. I find it highly commendable that t

Re: Build portability: enable or disable warnings

2011-05-19 Thread Alan Bateman
Jonathan Gibbons wrote There's a useful interim milestone which is relatively trivial to do. If javac -Xlint:all gives warnings, you can go javac -Xlint:all,-xyz to disable the xyz category of warnings. The specific value of xyz to use is given at the beginning of the warning message in squa

Re: Build portability: enable or disable warnings

2011-05-19 Thread Dr Andrew John Hughes
On 17:00 Thu 19 May , Kelly O'Hair wrote: > snip... > > But yes, a great project would be to see if we could get to 'javac -Xlint:all > -Werror' someday. > We really should... in fact it should be a requirement moving forward that > all java code be warning free, and stay that way. > S

Re: Build portability: enable or disable warnings

2011-05-19 Thread Dr Andrew John Hughes
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 o

Re: Build portability: enable or disable warnings

2011-05-19 Thread Dr Andrew John Hughes
On 09:47 Thu 19 May , David Holmes wrote: > Dr Andrew John Hughes said the following on 05/19/11 05:29: > > On 08:35 Mon 16 May , Kelly O'Hair wrote: > > >> The -Werror option is a blessing and a curse. I find it highly commendable > >> that teams (like > >> hotspot) have taken a 'no war

Re: Build portability: enable or disable warnings

2011-05-19 Thread Jonathan Gibbons
On 05/19/2011 08:00 AM, Kelly O'Hair wrote: On May 19, 2011, at 11:32 AM, 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 an

Re: Build portability: enable or disable warnings

2011-05-19 Thread Kelly O'Hair
On May 19, 2011, at 11:32 AM, 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 o

Re: Build portability: enable or disable warnings

2011-05-19 Thread Erik Trimble
On 5/18/2011 12:23 PM, Dr Andrew John Hughes wrote: On 07:25 Mon 16 May , Erik Trimble wrote: On 5/16/2011 6:03 AM, Andrew Haley wrote: On 05/16/2011 12:08 PM, Dalibor Topic wrote: The reason I'm asking is that I'm wondering if this is something we should expect to crop up in different pa

Re: Build portability: enable or disable warnings

2011-05-19 Thread Alan Bateman
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 h

Re: Build portability: enable or disable warnings

2011-05-18 Thread David Holmes
Dr Andrew John Hughes said the following on 05/19/11 05:29: On 08:35 Mon 16 May , Kelly O'Hair wrote: The -Werror option is a blessing and a curse. I find it highly commendable that teams (like hotspot) have taken a 'no warnings allowed' approach to their code base, more teams should do th

Re: Build portability: enable or disable warnings

2011-05-18 Thread Dr Andrew John Hughes
On 08:35 Mon 16 May , Kelly O'Hair wrote: > > On May 16, 2011, at 7:23 AM, Dr Andrew John Hughes wrote: > > > I think the issue is actually having -Werror enabled for all builds, not > > just debug builds. Without that, these additional warnings would just be > > noise. Having -Werror on al

Re: Build portability: enable or disable warnings

2011-05-18 Thread Dr Andrew John Hughes
On 07:25 Mon 16 May , Erik Trimble wrote: > On 5/16/2011 6:03 AM, Andrew Haley wrote: > > On 05/16/2011 12:08 PM, Dalibor Topic wrote: > > > >> The reason I'm asking is that I'm wondering if this is something we > >> should expect to crop up in different parts of the code base, or > >> whether

Re: Build portability: enable or disable warnings

2011-05-17 Thread Andrew Haley
On 17/05/11 06:53, Erik Trimble wrote: > On 5/16/2011 12:38 PM, Andrew Haley wrote: >> On 05/16/2011 07:59 PM, Dmitry Samersoff wrote: >>> Andrew, >>> >>> On 2011-05-16 21:12, Andrew Haley wrote: On 05/16/2011 05:50 PM, Dmitry Samersoff wrote: > Andrew, > > I guess we can add to bu

Re: Build portability: enable or disable warnings

2011-05-16 Thread Erik Trimble
On 5/16/2011 12:38 PM, Andrew Haley wrote: On 05/16/2011 07:59 PM, Dmitry Samersoff wrote: Andrew, On 2011-05-16 21:12, Andrew Haley wrote: On 05/16/2011 05:50 PM, Dmitry Samersoff wrote: Andrew, I guess we can add to build system something like ALT_COMPILER_FLAGS and turn on all warnings

Re: Build portability: enable or disable warnings

2011-05-16 Thread Andrew Haley
On 05/16/2011 07:59 PM, Dmitry Samersoff wrote: > Andrew, > > On 2011-05-16 21:12, Andrew Haley wrote: >> On 05/16/2011 05:50 PM, Dmitry Samersoff wrote: >>> Andrew, >>> >>> I guess we can add to build system something like >>> >>> ALT_COMPILER_FLAGS >>> >>> and turn on all warnings and -Werror by

Re: Build portability: enable or disable warnings

2011-05-16 Thread Dmitry Samersoff
Andrew, On 2011-05-16 21:12, Andrew Haley wrote: On 05/16/2011 05:50 PM, Dmitry Samersoff wrote: Andrew, I guess we can add to build system something like ALT_COMPILER_FLAGS and turn on all warnings and -Werror by default. Having zero-warning build is good practice and it's not too costly.

Re: Build portability: enable or disable warnings

2011-05-16 Thread Andrew Haley
On 05/16/2011 06:52 PM, Kelly O'Hair wrote: > > On May 16, 2011, at 10:12 AM, Andrew Haley wrote: > >> On 05/16/2011 05:50 PM, Dmitry Samersoff wrote: >>> Andrew, >>> >>> I guess we can add to build system something like >>> >>> ALT_COMPILER_FLAGS >>> >>> and turn on all warnings and -Werror by d

Re: Build portability: enable or disable warnings

2011-05-16 Thread Kelly O'Hair
On May 16, 2011, at 10:12 AM, Andrew Haley wrote: > On 05/16/2011 05:50 PM, Dmitry Samersoff wrote: >> Andrew, >> >> I guess we can add to build system something like >> >> ALT_COMPILER_FLAGS >> >> and turn on all warnings and -Werror by default. >> >> Having zero-warning build is good practi

Re: Build portability: enable or disable warnings

2011-05-16 Thread Andrew Haley
On 05/16/2011 05:50 PM, Dmitry Samersoff wrote: > Andrew, > > I guess we can add to build system something like > > ALT_COMPILER_FLAGS > > and turn on all warnings and -Werror by default. > > Having zero-warning build is good practice and it's not too costly. It'd drive you mad. gcc's -Wall i

Re: Build portability: enable or disable warnings

2011-05-16 Thread Kelly O'Hair
Be careful here, it actually can be very costly, and sometimes risky to fix the warnings. You could argue that it's worth the cost, but unless you force developers to keep the warnings at bay by using something like -Werror, many will ignore warnings, and then they just accumulate, like much of

Re: Build portability: enable or disable warnings

2011-05-16 Thread Dmitry Samersoff
Andrew, I guess we can add to build system something like ALT_COMPILER_FLAGS and turn on all warnings and -Werror by default. Having zero-warning build is good practice and it's not too costly. -Dmitry On 2011-05-16 19:56, Andrew Haley wrote: On 05/16/2011 04:35 PM, Kelly O'Hair wrote: On

Re: Build portability: enable or disable warnings

2011-05-16 Thread Andrew Haley
On 05/16/2011 04:35 PM, Kelly O'Hair wrote: > > On May 16, 2011, at 7:23 AM, Dr Andrew John Hughes wrote: > >> I think the issue is actually having -Werror enabled for all builds, not >> just debug builds. Without that, these additional warnings would just be >> noise. Having -Werror on also ca

Re: Build portability: enable or disable warnings

2011-05-16 Thread Kelly O'Hair
On May 16, 2011, at 7:23 AM, Dr Andrew John Hughes wrote: > I think the issue is actually having -Werror enabled for all builds, not > just debug builds. Without that, these additional warnings would just be > noise. Having -Werror on also causes problems just upgrading the version > of gcc, re

Re: Build portability: enable or disable warnings

2011-05-16 Thread Andrew Haley
On 05/16/2011 03:25 PM, Erik Trimble wrote: > On 5/16/2011 6:03 AM, Andrew Haley wrote: >> On 05/16/2011 12:08 PM, Dalibor Topic wrote: >> >>> The reason I'm asking is that I'm wondering if this is something we >>> should expect to crop up in different parts of the code base, or >>> whether it's a

Re: Build portability: enable or disable warnings

2011-05-16 Thread Erik Trimble
On 5/16/2011 6:03 AM, Andrew Haley wrote: On 05/16/2011 12:08 PM, Dalibor Topic wrote: The reason I'm asking is that I'm wondering if this is something we should expect to crop up in different parts of the code base, or whether it's a one off due to some specific thing some distros chose to do

Re: Build portability: enable or disable warnings

2011-05-16 Thread Dr Andrew John Hughes
On 14:03 Mon 16 May , Andrew Haley wrote: > On 05/16/2011 12:08 PM, Dalibor Topic wrote: > > On 5/16/11 12:48 PM, Andrew Haley wrote: > >> On 16/05/11 11:22, Dalibor Topic wrote: > >>> Any idea why, for example Fedora's & Debian's, default warning sets > >>> differ? > >> > >> Because the dist

Re: Build portability: enable or disable warnings

2011-05-16 Thread Andrew Haley
On 05/16/2011 12:08 PM, Dalibor Topic wrote: > On 5/16/11 12:48 PM, Andrew Haley wrote: >> On 16/05/11 11:22, Dalibor Topic wrote: >>> Any idea why, for example Fedora's & Debian's, default warning sets differ? >> >> Because the distros patch their versions of gcc. > > I don't see how the implica

Re: Build portability: enable or disable warnings

2011-05-16 Thread Dalibor Topic
On 5/16/11 12:48 PM, Andrew Haley wrote: > On 16/05/11 11:22, Dalibor Topic wrote: >> Any idea why, for example Fedora's & Debian's, default warning sets differ? > > Because the distros patch their versions of gcc. I don't see how the implication follows just yet - do you have an example? The r

Re: Build portability: enable or disable warnings

2011-05-16 Thread Andrew Haley
On 16/05/11 11:22, Dalibor Topic wrote: > On 5/16/11 11:04 AM, Andrew Haley wrote: >> Different distros enable different sets of warnings by default. > > Any idea why, for example Fedora's & Debian's, default warning sets differ? Because the distros patch their versions of gcc. Andrew.

Re: Build portability: enable or disable warnings

2011-05-16 Thread Dalibor Topic
On 5/16/11 11:04 AM, Andrew Haley wrote: > Different distros enable different sets of warnings by default. Any idea why, for example Fedora's & Debian's, default warning sets differ? cheers, dalibor topic -- Oracle Dalibor Topic | Java F/OSS Ambassador Phone: +494023646

Re: Build portability: enable or disable warnings

2011-05-16 Thread Andrew Haley
On 16/05/11 09:19, David Holmes wrote: > Fredrik Öhrström said the following on 05/16/11 17:39: >> 2011-05-13 15:20, Andrew Haley skrev: >>> A recent patch (of mine, as it happens) broke builds on Debian and >>> Gentoo. It was caused by a scanf call: >>> >>> if (sscanf(chars, "%lx-%*lx",

Re: Build portability: enable or disable warnings

2011-05-16 Thread David Holmes
Fredrik Öhrström said the following on 05/16/11 17:39: 2011-05-13 15:20, Andrew Haley skrev: A recent patch (of mine, as it happens) broke builds on Debian and Gentoo. It was caused by a scanf call: if (sscanf(chars, "%lx-%*lx", &x) == 1) which looks pretty innocuous, but it triggers

Re: Build portability: enable or disable warnings

2011-05-16 Thread Fredrik Öhrström
2011-05-13 15:20, Andrew Haley skrev: > A recent patch (of mine, as it happens) broke builds on Debian and > Gentoo. It was caused by a scanf call: > > if (sscanf(chars, "%lx-%*lx", &x) == 1) > > which looks pretty innocuous, but it triggers a warning if -Wformat is > turned on: > There

Build portability: enable or disable warnings

2011-05-13 Thread Andrew Haley
A recent patch (of mine, as it happens) broke builds on Debian and Gentoo. It was caused by a scanf call: if (sscanf(chars, "%lx-%*lx", &x) == 1) which looks pretty innocuous, but it triggers a warning if -Wformat is turned on: warning: use of assignment suppression and length modifier