public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Zack Weinberg <zack@codesourcery.com>
To: Phil Edwards <pedwards@disaster.jaj.com>
Cc: Gabriel Dos Reis <gdr@codesourcery.com>,
	dewar@gnat.com, fw@deneb.enyo.de, bosch@gnat.com,
	dnovillo@redhat.com, gcc@gcc.gnu.org, kenner@vlsi1.ultra.nyu.edu
Subject: Re: Really crummy error messages, was Re: Ada files now checked in
Date: Thu, 11 Oct 2001 14:04:00 -0000	[thread overview]
Message-ID: <20011011140437.F9432@codesourcery.com> (raw)
In-Reply-To: <20011008163225.A18409@disaster.jaj.com>

On Mon, Oct 08, 2001 at 04:32:25PM -0400, Phil Edwards wrote:
> On Mon, Oct 08, 2001 at 11:09:03AM -0700, Zack Weinberg wrote:
> > $ cat >test.c
> > int foo() { baz; }
> > $ gcc test.c
> > test.c: In function `foo':
> > test.c:1: `baz' undeclared (first use in this function)
> > test.c:1: (Each undeclared identifier is reported only once
> > test.c:1: for each function it appears in.)
> > $
> > 
> > Where is this "first use this function" coming from?
> 
> cp/lex.c, around line 1290.

Ah, the C++ compiler.  You didn't say which it was.

Hmm, there seems to be something else wrong:

$ cat test.c
int foo() { baz; }
int bar() { baz; }
$ g++ test.c
test.c: In function `int foo()':
test.c:1: `baz' undeclared (first use this function)
test.c:1: (Each undeclared identifier is reported only once for each function 
   it appears in.)

$ gcc test.c
test.c: In function `foo':
test.c:1: `baz' undeclared (first use in this function)
test.c:1: (Each undeclared identifier is reported only once
test.c:1: for each function it appears in.)
test.c: In function `bar':
test.c:2: `baz' undeclared (first use in this function)

They really ought to give identical error messages.

zw

      parent reply	other threads:[~2001-10-11 14:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-07 14:34 Phil Edwards
2001-10-07 23:01 ` Really crummy error messages Florian Weimer
2001-10-08 11:09 ` Really crummy error messages, was Re: Ada files now checked in Zack Weinberg
2001-10-08 13:31   ` Phil Edwards
2001-10-08 16:49     ` Tim Hollebeek
2001-10-09 23:32       ` Fergus Henderson
2001-10-10  2:25         ` Florian Weimer
2001-10-10 11:00         ` Phil Edwards
2001-10-11 14:04     ` Zack Weinberg [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20011011140437.F9432@codesourcery.com \
    --to=zack@codesourcery.com \
    --cc=bosch@gnat.com \
    --cc=dewar@gnat.com \
    --cc=dnovillo@redhat.com \
    --cc=fw@deneb.enyo.de \
    --cc=gcc@gcc.gnu.org \
    --cc=gdr@codesourcery.com \
    --cc=kenner@vlsi1.ultra.nyu.edu \
    --cc=pedwards@disaster.jaj.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).