🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Dave Newton Fri, 08 Dec 1989 23:28
compiler segv's
#699
Author: Dave Newton
Date: Fri, 08 Dec 1989 23:28
36 lines
1539 bytes
The following code was compiled on a SUN3. 
Changing "B(char* Name): (Name) {}" to  "B(char* Name): A(Name) {}"
seems to work.

#include <stream.h>

class A {
public:
  A() {}
  A(char* n) {name=n;}
  virtual char* Name() {return name;}
  char* name;
};

class B: public virtual A {
public:
  B(char* Name): (Name) {}
};

main() {
  B b("dave");
  cout << b.Name() << "\n";
}


g++-1.36.2 -g -O  -v -o testvbug1 testvbug1.cc
g++ version 1.36.2- (based on GCC 1.36)
 /usr/local/gnu/1.36.2/lib/gcc-cpp -+ -v -undef -D__GNUC__ -D__GNUG__ -D__cplusplus -Dmc68000 -Dsun -Dunix -D__mc68000__ -D__sun__ -D__unix__ -D__OPTIMIZE__ -D__HAVE_68881__ -Dmc68020 testvbug1.cc /usr/tmp/cca18915.cpp
GNU CPP version 1.36
 /usr/local/gnu/1.36.2/lib/gcc-cc1plus /usr/tmp/cca18915.cpp -quiet -dumpbase testvbug1.cc -g -O -version -o /usr/tmp/cca18915.s
GNU C++ version 1.36.2- (based on GCC 1.36) (68k, MIT syntax) compiled by GNU C version 1.36.
default target switches: -m68020 -mc68020 -m68881 -mbitfield
testvbug1.cc: In function int main ():
testvbug1.cc:17: Segmentation violation
g++-1.36.2: Program cc1plus 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