public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/20385] New: Lame error message for undefined type
@ 2005-03-08 18:21 falk at debian dot org
  2005-03-08 18:33 ` [Bug c/20385] " pinskia at gcc dot gnu dot org
  2005-03-08 18:59 ` joseph at codesourcery dot com
  0 siblings, 2 replies; 3+ messages in thread
From: falk at debian dot org @ 2005-03-08 18:21 UTC (permalink / raw)
  To: gcc-bugs

% cat test.c
unknowntype f() { return 0; }

% gcc -c test.c
test.c:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'f'

Firstly, since this is a frequent mistake, we should really be able to produce
"unknowntype used like a type", as other compilers do.

Secondly, IMHO this kind of "expected ..." error message is *never* a good
idea. I cannot recall a single instance where it was actually helpful to me,
and very often, as in this case, it is extremely confusing, and I would be 
better off with plain "syntax error before f" as it used to be in the old
parser. Even though my knowledge of C parsing is probably slightly above 
average, I have not the slightest idea why the parser expects '=', ',', ';',
'asm' or '__attribute__' here, and what I can derive from that about the
mistake I made. But maybe that's just me.

-- 
           Summary: Lame error message for undefined type
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: falk at debian dot org
                CC: gcc-bugs at gcc dot gnu dot org


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


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

end of thread, other threads:[~2005-03-08 18:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-08 18:21 [Bug c/20385] New: Lame error message for undefined type falk at debian dot org
2005-03-08 18:33 ` [Bug c/20385] " pinskia at gcc dot gnu dot org
2005-03-08 18:59 ` joseph at codesourcery dot com

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