public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* GCC Error messages
@ 2004-09-02 20:17 Luke Liu
  2004-09-02 20:38 ` Gabriel Dos Reis
  2004-09-02 20:43 ` Diego Novillo
  0 siblings, 2 replies; 12+ messages in thread
From: Luke Liu @ 2004-09-02 20:17 UTC (permalink / raw)
  To: 'gcc@gcc.gnu.org'

Hi,
I run gcc compiler with the following messages,

gcc -Wall -g -c junk.cpp -o junk
junk.cpp:3:19: MyInc.h: No such file or directory
junk.cpp:6: warning: ISO C++ forbids declaration of `main' with no type
junk.cpp: In function `int main()':
junk.cpp:7: `print' undeclared (first use this function)
junk.cpp:7: (Each undeclared identifier is reported only once for each
function it appears in.)

The gcc reports warning messages with keyword "warning", but does not report
error messages with keyword "Error". Is there any way for gcc to do this for
error messages?
Any helps?
Thanks!

Luke Liu
Sr. Analyst | N-Tier Core Services & Performance
Manhattan Associates, Inc.
Office: 678-597-6923
<http://www.manh.com>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: GCC Error messages
  2004-09-02 20:17 GCC Error messages Luke Liu
@ 2004-09-02 20:38 ` Gabriel Dos Reis
  2004-09-02 20:43 ` Diego Novillo
  1 sibling, 0 replies; 12+ messages in thread
From: Gabriel Dos Reis @ 2004-09-02 20:38 UTC (permalink / raw)
  To: Luke Liu; +Cc: 'gcc@gcc.gnu.org'

Luke Liu <LLiu@manh.com> writes:

| Hi,
| I run gcc compiler with the following messages,
| 
| gcc -Wall -g -c junk.cpp -o junk
| junk.cpp:3:19: MyInc.h: No such file or directory
| junk.cpp:6: warning: ISO C++ forbids declaration of `main' with no type
| junk.cpp: In function `int main()':
| junk.cpp:7: `print' undeclared (first use this function)
| junk.cpp:7: (Each undeclared identifier is reported only once for each
| function it appears in.)
| 
| The gcc reports warning messages with keyword "warning", but does not report
| error messages with keyword "Error". Is there any way for gcc to do this for
| error messages?
| Any helps?

You did not say which version of GCC you're using and what is your
testcase. Please use http://gcc.gnu.org/bugzilla/  for problem report.
GCC-3.3.x and GCC-3.4.x both report errors with "error:" prefix.

-- Gaby

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: GCC Error messages
  2004-09-02 20:17 GCC Error messages Luke Liu
  2004-09-02 20:38 ` Gabriel Dos Reis
@ 2004-09-02 20:43 ` Diego Novillo
  1 sibling, 0 replies; 12+ messages in thread
From: Diego Novillo @ 2004-09-02 20:43 UTC (permalink / raw)
  To: Luke Liu; +Cc: 'gcc@gcc.gnu.org'

On Thu, 2004-09-02 at 16:18, Luke Liu wrote:

> gcc -Wall -g -c junk.cpp -o junk
  ^^^
  g++


Diego.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: gcc error messages
  2002-08-26 10:15 gcc error messages Peter Fraser
  2002-08-26 12:49 ` Neil Booth
@ 2002-08-26 12:50 ` Joe Buck
  1 sibling, 0 replies; 12+ messages in thread
From: Joe Buck @ 2002-08-26 12:50 UTC (permalink / raw)
  To: Peter Fraser; +Cc: 'gcc@gnu.org'

> In gcc when you "switch" on a "enum"
> and there is no "default:". gcc issues a 
> warning message for each declared "enum" value
> that does not have a "case"  In general
> this is a good idea. It stops errors.
> 
> But in the case of "enum"s with a large number
> of members. A simple syntax error can ending
> generating a vast number of useless warning
> messages. In my case an extra '}' ended up
> generating over 500 lines of warning messages.
> 
> This much output does not help the programmer.
> It would be better is if gcc took a ratio
> of the missing "enum" values to the total set
> of values and issued just one message if the
> ratio was large.  I suggest the number
> should be: one message if there are more than 5
> missing "enum" values or more then 10% missing 
> "enum" values, otherwise print a message for
> each "enum" value.

Alternatively, always generate one message, which would list the first few
missing enums (perhaps up to 5 as you suggest), together with a count of
how many aren't handled if there are more than that.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: gcc error messages
  2002-08-26 10:15 gcc error messages Peter Fraser
@ 2002-08-26 12:49 ` Neil Booth
  2002-08-26 12:50 ` Joe Buck
  1 sibling, 0 replies; 12+ messages in thread
From: Neil Booth @ 2002-08-26 12:49 UTC (permalink / raw)
  To: Peter Fraser; +Cc: 'gcc@gnu.org'

Peter Fraser wrote:-

> But in the case of "enum"s with a large number
> of members. A simple syntax error can ending
> generating a vast number of useless warning
> messages. In my case an extra '}' ended up
> generating over 500 lines of warning messages.

Indeed.  Listing the enums in a single diagnostic seems
better.

Neil.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* gcc error messages
@ 2002-08-26 10:15 Peter Fraser
  2002-08-26 12:49 ` Neil Booth
  2002-08-26 12:50 ` Joe Buck
  0 siblings, 2 replies; 12+ messages in thread
From: Peter Fraser @ 2002-08-26 10:15 UTC (permalink / raw)
  To: 'gcc@gnu.org'

In gcc when you "switch" on a "enum"
and there is no "default:". gcc issues a 
warning message for each declared "enum" value
that does not have a "case"  In general
this is a good idea. It stops errors.

But in the case of "enum"s with a large number
of members. A simple syntax error can ending
generating a vast number of useless warning
messages. In my case an extra '}' ended up
generating over 500 lines of warning messages.

This much output does not help the programmer.
It would be better is if gcc took a ratio
of the missing "enum" values to the total set
of values and issued just one message if the
ratio was large.  I suggest the number
should be: one message if there are more than 5
missing "enum" values or more then 10% missing 
"enum" values, otherwise print a message for
each "enum" value.

__________________
Peter J Fraser	519 895 1860 x201
Thinkage		519 895 1864 fax
85 McIntyre Dr
Kitchener
On N2R 1H6 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: gcc error messages
  2001-02-02 14:55     ` Joe Buck
@ 2001-02-02 15:03       ` Neil Booth
  0 siblings, 0 replies; 12+ messages in thread
From: Neil Booth @ 2001-02-02 15:03 UTC (permalink / raw)
  To: Joe Buck; +Cc: Stephen Smith, GCC

Joe Buck wrote:-

> It seems that we no longer have one of my favorites,
> 
> converting `%T' to `%T' is a contravariance violation
> 
> but there are other "special" messages lurking about.

I like that!  Never saw it, though...

Neil.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: gcc error messages
  2001-02-02 12:02   ` Neil Booth
@ 2001-02-02 14:55     ` Joe Buck
  2001-02-02 15:03       ` Neil Booth
  0 siblings, 1 reply; 12+ messages in thread
From: Joe Buck @ 2001-02-02 14:55 UTC (permalink / raw)
  To: Neil Booth; +Cc: Stephen Smith, GCC

[ List of error messages ]
> That would be a maintenance headache, though.  They change pretty
> regularly; certainly in CPP almost all have been changed slightly over
> the last 9 months.

Well, it would need to be maintained, but there are other, similar places
where maintainance is needed, like invoke.texi.  Currently, if you add
a new switch you need to update invoke.texi.  If we had errmsgs.texi,
then when you add a new error you would update errmsgs.texi.

But it's not necessary for the document to be perfect to be useful.
Probably 80% of the error messages are completely self-explanatory even to
beginners, and another 15% to experienced programmers, but there are a few
that probably cause even experienced programmer to scratch their heads.
It seems that we no longer have one of my favorites,

converting `%T' to `%T' is a contravariance violation

but there are other "special" messages lurking about.


> [BTW his name is Zack :-)]

Sorry, Zack.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: gcc error messages
  2001-02-02 11:20 ` Joe Buck
@ 2001-02-02 12:02   ` Neil Booth
  2001-02-02 14:55     ` Joe Buck
  0 siblings, 1 reply; 12+ messages in thread
From: Neil Booth @ 2001-02-02 12:02 UTC (permalink / raw)
  To: Joe Buck; +Cc: Stephen Smith, GCC

Joe Buck wrote:-

> No, there isn't.
> 
> Zach, you could add this to your list of beginner projects.

That would be a maintenance headache, though.  They change pretty
regularly; certainly in CPP almost all have been changed slightly over
the last 9 months.

[BTW his name is Zack :-)]

Neil.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: gcc error messages
@ 2001-02-02 11:21 Mike Stump
  0 siblings, 0 replies; 12+ messages in thread
From: Mike Stump @ 2001-02-02 11:21 UTC (permalink / raw)
  To: gcc, ischis2

> Date: Fri, 02 Feb 2001 09:58:37 -0700
> From: Stephen Smith <ischis2@home.com>
> To: GCC <gcc@gcc.gnu.org>

> Is there an official list of error messages for gcc.

Nope.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: gcc error messages
  2001-02-02  8:58 Stephen Smith
@ 2001-02-02 11:20 ` Joe Buck
  2001-02-02 12:02   ` Neil Booth
  0 siblings, 1 reply; 12+ messages in thread
From: Joe Buck @ 2001-02-02 11:20 UTC (permalink / raw)
  To: Stephen Smith; +Cc: GCC

> Is there an official list of error messages for gcc.  I see some unofficial
> ones, but not an official set.

No, there isn't.

Zach, you could add this to your list of beginner projects.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* gcc error messages
@ 2001-02-02  8:58 Stephen Smith
  2001-02-02 11:20 ` Joe Buck
  0 siblings, 1 reply; 12+ messages in thread
From: Stephen Smith @ 2001-02-02  8:58 UTC (permalink / raw)
  To: GCC

Is there an official list of error messages for gcc.  I see some unofficial
ones, but not an official set.

sps

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2004-09-02 20:43 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-02 20:17 GCC Error messages Luke Liu
2004-09-02 20:38 ` Gabriel Dos Reis
2004-09-02 20:43 ` Diego Novillo
  -- strict thread matches above, loose matches on Subject: below --
2002-08-26 10:15 gcc error messages Peter Fraser
2002-08-26 12:49 ` Neil Booth
2002-08-26 12:50 ` Joe Buck
2001-02-02 11:21 Mike Stump
2001-02-02  8:58 Stephen Smith
2001-02-02 11:20 ` Joe Buck
2001-02-02 12:02   ` Neil Booth
2001-02-02 14:55     ` Joe Buck
2001-02-02 15:03       ` Neil Booth

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).