Re: cc1.exe: warnings being treated as errors

2011-10-06 Thread Jon Grant

Jonathan Wakely wrote, On 26/09/11 09:57:
[.]

Feel free to request a new option in Bugzilla to suppress the note,
that's the right place for this discussion.


Good point. I've created a ticket:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50643

Regards, Jon


Re: cc1.exe: warnings being treated as errors

2011-09-26 Thread Jon Grant

Hi Jonathan

Jonathan Wakely wrote, On 24/09/11 15:55:

On 24 September 2011 15:40, Jon Grant wrote:

It's kind of re-iterating the command line options, that the user will
choose to be aware of already. I don't recall seeing that text output before
about ~1 year ago.


It was there in GCC 4.1, maybe earlier, I didn't check.


However, coming back to my query: Is there a need to remind the user 
that warnings on the build are being treated as errors? Is this a 
special case because it would cause the build to stop?


For example: -Wall means I see control reaches end of non-void 
function messages, but doesn't output cc1.exe: all warnings turned on



I'd thought because the previous line of output said gcc -Werror -Wall -o
main main.c, the options clear.


Not if you run make and it doesn't echo the compiler command, or run
the compiler from an IDE, or anything else which shows the errors but
not the command.


I would have though that it's not GCC's responsibility to echo the 
options passed to it. Like the IDE example, the IDE can inform the user 
of what compiler options are in use; I don't see why GCC can't keep 
quiet about -Werror.


Best regards, Jon


Re: cc1.exe: warnings being treated as errors

2011-09-26 Thread Jonathan Wakely
On 26 September 2011 09:33, Jon Grant wrote:
 For example: -Wall means I see control reaches end of non-void function
 messages, but doesn't output cc1.exe: all warnings turned on

But it does tell you which option that warning came from: [-Wreturn-type]

So if you want to disable it you can use -Wno-return-type

If you want to make it a warning not an error you can stop using
-Werror, so you get a notice that's in use.

Feel free to request a new option in Bugzilla to suppress the note,
that's the right place for this discussion.


Re: cc1.exe: warnings being treated as errors

2011-09-26 Thread Andrew Haley
On 09/19/2011 06:59 PM, Jon Grant wrote:

 
 I noticed that when compiling C files with GCC and using the -Werror
 option, I see this additional output:
 
 cc1.exe: warnings being treated as errors
 ./src/main.c: In function 'main':
 ./src/main.c:41:15: error: unused variable 'hello'
 
 Is the cc1 line output needed?

Oh, sure.  It's really helpful to see an explanation as to why the
compilation stopped on an apparently legal C program.

Andrew.


Re: cc1.exe: warnings being treated as errors

2011-09-26 Thread Ian Lance Taylor
Andrew Haley a...@redhat.com writes:

 On 09/19/2011 06:59 PM, Jon Grant wrote:

 
 I noticed that when compiling C files with GCC and using the -Werror
 option, I see this additional output:
 
 cc1.exe: warnings being treated as errors
 ./src/main.c: In function 'main':
 ./src/main.c:41:15: error: unused variable 'hello'
 
 Is the cc1 line output needed?

 Oh, sure.  It's really helpful to see an explanation as to why the
 compilation stopped on an apparently legal C program.

In the past, definitely, but today I'm going to argue that now that
-fdiagnostics-show-option is the default, we can reasonably remove that
line.  Consider:

foo.c: In function ‘foo’:
foo.c:1:18: error: unused variable ‘hello’ [-Werror=unused-variable]
cc1: all warnings being treated as errors

The -Werror= tag output by -fdiagnostics-show-option provides all the
required information.

Ian


Re: cc1.exe: warnings being treated as errors

2011-09-26 Thread Andrew Haley
On 09/26/2011 05:11 PM, Ian Lance Taylor wrote:
 Andrew Haley a...@redhat.com writes:
 
 On 09/19/2011 06:59 PM, Jon Grant wrote:


 I noticed that when compiling C files with GCC and using the -Werror
 option, I see this additional output:

 cc1.exe: warnings being treated as errors
 ./src/main.c: In function 'main':
 ./src/main.c:41:15: error: unused variable 'hello'

 Is the cc1 line output needed?

 Oh, sure.  It's really helpful to see an explanation as to why the
 compilation stopped on an apparently legal C program.
 
 In the past, definitely, but today I'm going to argue that now that
 -fdiagnostics-show-option is the default, we can reasonably remove that
 line.  Consider:
 
 foo.c: In function ‘foo’:
 foo.c:1:18: error: unused variable ‘hello’ [-Werror=unused-variable]
 cc1: all warnings being treated as errors
 
 The -Werror= tag output by -fdiagnostics-show-option provides all the
 required information.

That's probably true.

Andrew.


Re: cc1.exe: warnings being treated as errors

2011-09-24 Thread Jon Grant

Jonathan Wakely wrote, On 19/09/11 19:40:

On 19 September 2011 18:59, Jon Grant wrote:

Hello

I noticed that when compiling C files with GCC and using the -Werror
option, I see this additional output:

cc1.exe: warnings being treated as errors
./src/main.c: In function 'main':
./src/main.c:41:15: error: unused variable 'hello'

Is the cc1 line output needed? Just wondering if it could be
removed. Appears superfluous.


It's not superfluous, it says that the error following might have been
a warning, except that -Werror was used.

If you don't want it you can either fix the warning or not use -Werror.


It's kind of re-iterating the command line options, that the user will 
choose to be aware of already. I don't recall seeing that text output 
before about ~1 year ago.


I'd thought because the previous line of output said gcc -Werror -Wall 
-o main main.c, the options clear.


If it's really vauluble, that output could be turned on by an option 
itself! -Wdisplay-warning-upgrade. Leaving it off by default.


Best regards, Jon


Re: cc1.exe: warnings being treated as errors

2011-09-24 Thread Jonathan Wakely
On 24 September 2011 15:40, Jon Grant wrote:
 It's kind of re-iterating the command line options, that the user will
 choose to be aware of already. I don't recall seeing that text output before
 about ~1 year ago.

It was there in GCC 4.1, maybe earlier, I didn't check.

 I'd thought because the previous line of output said gcc -Werror -Wall -o
 main main.c, the options clear.

Not if you run make and it doesn't echo the compiler command, or run
the compiler from an IDE, or anything else which shows the errors but
not the command.


Re: cc1.exe: warnings being treated as errors

2011-09-24 Thread Jakub Jelinek
On Sat, Sep 24, 2011 at 03:55:10PM +0100, Jonathan Wakely wrote:
 On 24 September 2011 15:40, Jon Grant wrote:
  It's kind of re-iterating the command line options, that the user will
  choose to be aware of already. I don't recall seeing that text output before
  about ~1 year ago.
 
 It was there in GCC 4.1, maybe earlier, I didn't check.

GCC 3.2 behaves the same and a brief look at SVN shows GCC has been doing
that already back in 1992, maybe earlier.

Jakub


Re: cc1.exe: warnings being treated as errors

2011-09-19 Thread Jonathan Wakely
On 19 September 2011 18:59, Jon Grant wrote:
 Hello

 I noticed that when compiling C files with GCC and using the -Werror
 option, I see this additional output:

 cc1.exe: warnings being treated as errors
 ./src/main.c: In function 'main':
 ./src/main.c:41:15: error: unused variable 'hello'

 Is the cc1 line output needed? Just wondering if it could be
 removed. Appears superfluous.

It's not superfluous, it says that the error following might have been
a warning, except that -Werror was used.

If you don't want it you can either fix the warning or not use -Werror.