Thread View: gnu.g++.bug
1 messages
1 total messages
Started by gerry wiener
Wed, 22 Mar 1989 13:36
compilation gives core using g++.1-34.1 on sun4-os4
Author: gerry wiener
Date: Wed, 22 Mar 1989 13:36
Date: Wed, 22 Mar 1989 13:36
42 lines
1241 bytes
1241 bytes
Compiling following program taken from C++Programming by John Berry (pg22)
generates a core dump using g++-1.34.1 on sun4-os4:
hail:gerry:1>g++ p22.c
In function int main ():
p22.c:25: Segmentation violation
Program c++ got fatal signal 11.
hail:gerry:2>
If x.area is replaced by x.area() and y.area is replaced by y.area()
it compiles correctly.
-------------------------------------------------------------------------------
#include <stream.h>
struct square
{
int side;
void set(int);
int area();
};
void square::set(int x)
{
side = x;
}
int square::area()
{
return(side*side);
}
main()
{
square x, y;
x.set(2);
cout << "area of square x = " << x.area << "\n";
y.set(3);
cout << "area of square y = " << y.area << "\n";
}
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads