* cc1.exe: warnings being treated as errors
@ 2011-09-19 18:00 Jon Grant
2011-09-19 18:41 ` Jonathan Wakely
2011-09-26 10:54 ` Andrew Haley
0 siblings, 2 replies; 11+ messages in thread
From: Jon Grant @ 2011-09-19 18:00 UTC (permalink / raw)
To: gcc
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.
If compiling with g++ it is :
cc1plus: warnings being treated as errors
I saw this in two slightly old builds of GCC:
arm-none-eabi-gcc-4.5.1.exe (Sourcery G++ Lite 2010.09-51) 4.5.1
gcc (Ubuntu 4.4.3-4ubuntu5) 4.4.3
Please keep my email address in any replies as I'm not on the mailing list.
Best regards, Jon
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: cc1.exe: warnings being treated as errors
2011-09-19 18:00 cc1.exe: warnings being treated as errors Jon Grant
@ 2011-09-19 18:41 ` Jonathan Wakely
2011-09-24 14:40 ` Jon Grant
2011-09-26 10:54 ` Andrew Haley
1 sibling, 1 reply; 11+ messages in thread
From: Jonathan Wakely @ 2011-09-19 18:41 UTC (permalink / raw)
To: Jon Grant; +Cc: gcc
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.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: cc1.exe: warnings being treated as errors
2011-09-19 18:41 ` Jonathan Wakely
@ 2011-09-24 14:40 ` Jon Grant
2011-09-24 14:55 ` Jonathan Wakely
0 siblings, 1 reply; 11+ messages in thread
From: Jon Grant @ 2011-09-24 14:40 UTC (permalink / raw)
To: Jonathan Wakely; +Cc: gcc
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
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: cc1.exe: warnings being treated as errors
2011-09-24 14:40 ` Jon Grant
@ 2011-09-24 14:55 ` Jonathan Wakely
2011-09-24 15:24 ` Jakub Jelinek
2011-09-26 9:08 ` Jon Grant
0 siblings, 2 replies; 11+ messages in thread
From: Jonathan Wakely @ 2011-09-24 14:55 UTC (permalink / raw)
To: Jon Grant; +Cc: gcc
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.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: cc1.exe: warnings being treated as errors
2011-09-24 14:55 ` Jonathan Wakely
@ 2011-09-24 15:24 ` Jakub Jelinek
2011-09-26 9:08 ` Jon Grant
1 sibling, 0 replies; 11+ messages in thread
From: Jakub Jelinek @ 2011-09-24 15:24 UTC (permalink / raw)
To: Jonathan Wakely; +Cc: Jon Grant, gcc
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
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: cc1.exe: warnings being treated as errors
2011-09-24 14:55 ` Jonathan Wakely
2011-09-24 15:24 ` Jakub Jelinek
@ 2011-09-26 9:08 ` Jon Grant
2011-09-26 9:30 ` Jonathan Wakely
1 sibling, 1 reply; 11+ messages in thread
From: Jon Grant @ 2011-09-26 9:08 UTC (permalink / raw)
To: Jonathan Wakely; +Cc: gcc
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
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: cc1.exe: warnings being treated as errors
2011-09-26 9:08 ` Jon Grant
@ 2011-09-26 9:30 ` Jonathan Wakely
2011-10-06 23:46 ` Jon Grant
0 siblings, 1 reply; 11+ messages in thread
From: Jonathan Wakely @ 2011-09-26 9:30 UTC (permalink / raw)
To: Jon Grant; +Cc: gcc
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.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: cc1.exe: warnings being treated as errors
2011-09-19 18:00 cc1.exe: warnings being treated as errors Jon Grant
2011-09-19 18:41 ` Jonathan Wakely
@ 2011-09-26 10:54 ` Andrew Haley
2011-09-26 16:26 ` Ian Lance Taylor
1 sibling, 1 reply; 11+ messages in thread
From: Andrew Haley @ 2011-09-26 10:54 UTC (permalink / raw)
To: gcc
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.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: cc1.exe: warnings being treated as errors
2011-09-26 10:54 ` Andrew Haley
@ 2011-09-26 16:26 ` Ian Lance Taylor
2011-09-26 16:57 ` Andrew Haley
0 siblings, 1 reply; 11+ messages in thread
From: Ian Lance Taylor @ 2011-09-26 16:26 UTC (permalink / raw)
To: Andrew Haley; +Cc: gcc
Andrew Haley <aph@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
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: cc1.exe: warnings being treated as errors
2011-09-26 16:26 ` Ian Lance Taylor
@ 2011-09-26 16:57 ` Andrew Haley
0 siblings, 0 replies; 11+ messages in thread
From: Andrew Haley @ 2011-09-26 16:57 UTC (permalink / raw)
To: Ian Lance Taylor; +Cc: gcc
On 09/26/2011 05:11 PM, Ian Lance Taylor wrote:
> Andrew Haley <aph@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.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: cc1.exe: warnings being treated as errors
2011-09-26 9:30 ` Jonathan Wakely
@ 2011-10-06 23:46 ` Jon Grant
0 siblings, 0 replies; 11+ messages in thread
From: Jon Grant @ 2011-10-06 23:46 UTC (permalink / raw)
To: Jonathan Wakely; +Cc: gcc
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
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2011-10-06 22:18 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-19 18:00 cc1.exe: warnings being treated as errors Jon Grant
2011-09-19 18:41 ` Jonathan Wakely
2011-09-24 14:40 ` Jon Grant
2011-09-24 14:55 ` Jonathan Wakely
2011-09-24 15:24 ` Jakub Jelinek
2011-09-26 9:08 ` Jon Grant
2011-09-26 9:30 ` Jonathan Wakely
2011-10-06 23:46 ` Jon Grant
2011-09-26 10:54 ` Andrew Haley
2011-09-26 16:26 ` Ian Lance Taylor
2011-09-26 16:57 ` Andrew Haley
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).