From mboxrd@z Thu Jan 1 00:00:00 1970 From: Zack Weinberg To: Phil Edwards Cc: Gabriel Dos Reis , 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 Message-id: <20011011140437.F9432@codesourcery.com> References: <20011007173547.A15654@disaster.jaj.com> <20011008110903.E9432@codesourcery.com> <20011008163225.A18409@disaster.jaj.com> X-SW-Source: 2001-10/msg00732.html 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