ojr@itk.unit.no (10/30/89)
The following program causes a segment violation both on sparcstation
and sun3.
Our configuration:
sun-os4
sun3/sun4
g++ version 1.36- last changed Wed Oct 11 1989
----------------------------------------
class A
{
public:
A() {printf("Hello world\n");}
};
extern "C"
{
void printf(char*,...);
};
A a;
-----------------------------------------
g++ -v
gcc version 1.36.0- (based on GCC 1.36)
g++ -c bug2.cc
g++ -c bug2.cc
bug2.cc: In method A::A ():
bug2.cc:19: warning: implicit declaration of function `printf'
bug2.cc: At top level:
bug2.cc:24: warning: `printf' was previously implicitly declared to return `int'
bug2.cc: In function void _GLOBAL_$I$bug2_cc ():
bug2.cc:19: warning: bug2.cc:27: Segmentation violation
g++: Program cc1plus got fatal signal 11.
Ornulf Jan Rodseth M.Sc. Telephone
SINTEF Dep. of Automatic Control (+47 7) 594351 Direct
N-7034 TRONDHEIM (+47 7) 594375 Switchboard
NORWAY (+47 7) 594399 Fax
ojr%regtek.unit.uninett@tor.nta.no (EAN) ojr@itk.unit.no (ARPA)