🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

G++ 1.32 needs optional & before function argument

#1654
From: Tom Vijlbrief
Date: Fri, 27 Jan 1989 09:43
45 lines
1747 bytes
The G++ 1.32 (SunOs 3.5, Sun 3/60)
complains about this program:
===========================

#define	NULL	0

typedef void (*exceptionTrapTy)(unsigned&, int& ...);

class ExceptionTrap {
	exceptionTrapTy old_trap;
public:
	ExceptionTrap(exceptionTrapTy xtrap =NULL);
	~ExceptionTrap();
};

void xtrap(unsigned& err, int& sev)
{
	err= 0;
	sev= 0;
}


main()
{
		ExceptionTrap x(xtrap); // Error ?!, fix by using:
		// ExceptionTrap x(&xtrap); 
}
========================
tom@sunflare:~/src/CC/bug> g++ -v -S errbug.c
g++ version 1.32.0
 /usr/local/lib/gcc-cpp -+ -v -undef -D__GNU__ -D__GNUG__ -Dmc68000 -Dsun -Dunix -D__HAVE_68881__ -Dmc68020 errbug.c /tmp/cca10049.cpp
GNU CPP version 1.32
 /usr/local/lib/gcc-c++ /tmp/cca10049.cpp -quiet -dumpbase errbug.c -version -o errbug.s
GNU C++ version 1.32.0 (68k, MIT syntax) compiled by GNU C version 1.32.
In function int main ():
errbug.c:21: bad argument to constructor `ExceptionTrap'
===========================

===============================================================================
Tom Vijlbrief
TNO Institute for Perception
P.O. Box 23				Phone: +31 34 63 62 77
3769 ZG  Soesterberg			E-mail: tnosoes!tom@mcvax.cwi.nl
The Netherlands				    or:	uunet!mcvax!tnosoes!tom
===============================================================================
Technical Details
Message-ID: <436@tnosoes.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ukma!xanth!uunet!mcvax!hp4nl!tnosoes!tom

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ukma!xanth!uunet!mcvax!hp4nl!tnosoes!tom
From: tom@tnosoes.UUCP (Tom Vijlbrief)
Newsgroups: gnu.g++.bug
Subject: G++ 1.32 needs optional & before function argument
Message-ID: <436@tnosoes.UUCP>
Date: 27 Jan 89 09:43:31 GMT
Organization: TNO Institute for Perception, Soesterberg, The Netherlands
Lines: 45