🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Igor Metz Mon, 18 Dec 1989 10:16
g++ 1.36.2 on Sun-4 OS-4 dumps core
#2102
Author: Igor Metz
Date: Mon, 18 Dec 1989 10:16
75 lines
2241 bytes
Configuration:
  Sun-4  SunOS 4.0.3
  g++    1.36.2 from interviews.stanford.edu
  libg++ 1.36.1 from prep.ai.mit.edu

Problem:
  g++ loops or dumps core (fatal signal 6)

Consider the following code
---------------------------------------------
class BinTree {
protected:
  short    d;
  short    n;

public:
  BinTree(short dim, short N);
  BinTree(short dim, short N) {
    if ((dim*N + 1) <= 100) {
      d = dim; n = N;
    }
   };
};

int
main() {
  BinTree b(3,2);
}
---------------------------------------------

Compiling this gives:

g++ version 1.36.2 (based on GCC 1.36)
 /usr/local/lib/1.36.2/gcc-cpp -+ -v -undef -D__GNUC__ -D__GNUG__ -D__cplusplus
-Dsparc -Dsun -Dunix -D__sparc__ -D__sun__ -D__unix__ gaga2.cc /usr/tmp/cca17997.cpp
GNU CPP version 1.36
 /usr/local/lib/1.36.2/gcc-cc1plus /usr/tmp/cca17997.cpp -quiet -dumpbase gaga2.cc -version -o /usr/tmp/cca17997.s
GNU C++ version 1.36.2 (based on GCC 1.36) (sparc) compiled by GNU C version 1.36.
default target switches: -mfpu -mepilogue
newg++: Program cc1plus got fatal signal 6.

Sometimes the compiler dumps core, sometimes it loops!!!
If I transform the code to

---------------------------------------------
class BinTree {
protected:
  short    d;
  short    n;

public:
  BinTree(short dim, short N);
};

BinTree::BinTree(short dim, short N) 
{
  if ((dim*N + 1) <= 100) {
    d = dim; n = N;
  }
};

int
main() {
  BinTree b(3,2);
}
---------------------------------------------

it compiles without any errors.

Igor Metz                    X400: metz@iam.unibe.ch
Institut fuer Informatik     ARPA: metz%iam.unibe.ch@relay.cs.net
und angewandte Mathematik    UUCP: ..!uunet!mcvax!iam.unibe.ch!metz
Universitaet Bern            Phone: (0041) 31 65 49 90
Switzerland		     Fax:   (0041) 31 65 39 65
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