🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.g++.bug
Article #1737

G++ 1.34.1 Undeclared identifier warnings

#1737
From: rjc
Date: Thu, 16 Mar 1989 18:38
63 lines
2550 bytes
G++ 1.34.1 GCC 1.34
Vax 8350, Ultrix 2.2-1 System #4
config.g++ vax

I am told that "Each undeclared identifier is reported only once for
each function it appears in."  This clearly is not the case.

bug.cc
-----------------------------------------------------------------------
/* test undeclared identifier warnings
 * Rob Collins (rjc@cs.ucla.edu)
 */

struct A {
	int i;
	A(int x) { printf("A(%d)\n", x); i = x; };
	A(A& x) { printf("A(A& x), x.i == %d\n", x.i); i = x.i; };
	~A(void) { printf("~A(%d)\n", i); };
	void operator += (A& x) { printf("+=(%d, %d)\n", i, x.i); i += x.i; };
};

A foo (void)
{
	tmp = 1;
	tmp = 1;
	tmp = 1;
	tmp = 1;
	tmp = 1;
	printf("foo(void), tmp.i == %d\n", tmp.i);
	return tmp;
}

main()
{
	A bar = 5;
	bar += foo();
	printf("main(), bar.i == %d\n", bar.i);
}
-----------------------------------------------------------------------

Script started on Thu Mar 16 10:39:20 1989
% g++ -v bug.cc
g++ version 1.34.1
 /usr/local/lib/gcc-cpp -+ -v -undef -D__GNU__ -D__GNUG__ -Dvax -Dunix -D__vax__ -D__unix__ bug.cc /tmp/cc007973.cpp
GNU CPP version 1.34
 /usr/local/lib/gcc-c++ /tmp/cc007973.cpp -quiet -dumpbase bug.cc -noreg -version -o /tmp/cc007973.s
GNU C++ version 1.34.1 (vax) compiled by GNU C version 1.34.
In function foo ():
bug.cc:15: `tmp' was not declared (first use this function)
bug.cc:15: (Each undeclared identifier is reported only once
bug.cc:15: for each function it appears in.)
bug.cc:16: `tmp' was not declared (first use this function)
bug.cc:17: `tmp' was not declared (first use this function)
bug.cc:18: `tmp' was not declared (first use this function)
bug.cc:19: `tmp' was not declared (first use this function)
bug.cc:20: `tmp' was not declared (first use this function)
bug.cc:21: `tmp' was not declared (first use this function)
% ^D
script done on Thu Mar 16 10:39:34 1989
-------------------------------------------------------------------------------
rjc@cs.ucla.edu
This is what happens when I sit on my keyboard: AISBDFAORI:KHGEDSYTFBFISKVDJ MN
Next week:  what happens when I throw my keyboard out the window!
Technical Details
Message-ID: <21851@shemp.CS.UCLA.EDU>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!rutgers!ucla-cs!rjc

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!rutgers!ucla-cs!rjc
From: rjc@maui.cs.ucla.edu
Newsgroups: gnu.g++.bug
Subject: G++ 1.34.1 Undeclared identifier warnings
Message-ID: <21851@shemp.CS.UCLA.EDU>
Date: 16 Mar 89 18:38:00 GMT
Sender: news@CS.UCLA.EDU
Reply-To: rjc@CS.UCLA.EDU ()
Distribution: gnu
Organization: UCLA Computer Science Department
Lines: 63