Thread View: gnu.g++.bug
1 messages
1 total messages
Started by zhao
Sun, 19 Mar 1989 19:12
Bug -> Warning?
Author: zhao
Date: Sun, 19 Mar 1989 19:12
Date: Sun, 19 Mar 1989 19:12
38 lines
1733 bytes
1733 bytes
Should g++ emit warning against the bug shown in the following program?
I am running g++-1.34.1 on a SUN3/60M OS4.0.1.
[1]: cat bug.c
class base;
class base {
private:
base *next;
public:
base (void);
#ifndef BUG
void Insert (base* elem);
#else
void Insert (base*& elem);
#endif
};
void main (void) {
base* FOO = new base ();
FOO->Insert (new base());
}
[2]: g++ -c -v bug.c
g++ version 1.34.1
/home/wiener/local/lib/gcc-cpp -+ -v -undef -D__GNU__ -D__GNUG__ -Dmc68000 -Dsun -Dunix -D__mc68000__ -D__sun__ -D__unix__ -D__HAVE_68881__ -Dmc68020 bug.c /tmp/cca02876.cpp
GNU CPP version 1.34
/home/wiener/local/lib/gcc-c++ /tmp/cca02876.cpp -quiet -dumpbase bug.c -version -o /tmp/cca02876.s
GNU C++ version 1.34.1 (68k, MIT syntax) compiled by GNU C version 1.34.
as -mc68020 /tmp/cca02876.s -o bug.o
[3]: g++ -c -DBUG -v bug.c
g++ version 1.34.1
/home/wiener/local/lib/gcc-cpp -+ -v -DBUG -undef -D__GNU__ -D__GNUG__ -Dmc68000 -Dsun -Dunix -D__mc68000__ -D__sun__ -D__unix__ -D__HAVE_68881__ -Dmc68020 bug.c /tmp/cca02880.cpp
GNU CPP version 1.34
/home/wiener/local/lib/gcc-c++ /tmp/cca02880.cpp -quiet -dumpbase bug.c -version -o /tmp/cca02880.s
GNU C++ version 1.34.1 (68k, MIT syntax) compiled by GNU C version 1.34.
In function void main ():
bug.c:18: Segmentation violation
Program c++ got fatal signal 11.
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