🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by James Clark Sun, 26 Mar 1989 08:16
g++ 1.34.1 gets segmentation violation
#1789
Author: James Clark
Date: Sun, 26 Mar 1989 08:16
41 lines
1732 bytes
g++ 1.34.1 gets a segmentation violation if one erroneously
supplies a return type for a constructor.

jclark% cat test.c

struct foo {
  void foo();
};

jclark% g++ -g -v -c test.c
g++ version 1.34.1
 /usr/local/lib/gcc-cpp -+ -v -undef -D__GNU__ -D__GNUG__ -Dsparc -Dsun -Dunix -D__sparc__ -D__sun__ -D__unix__ test.c /tmp/cca14546.cpp
GNU CPP version 1.34
 /usr/local/lib/gcc-c++ /tmp/cca14546.cpp -quiet -dumpbase test.c -g -version -o /tmp/cca14546.s
GNU C++ version 1.34.1 (sparc) compiled by GNU C version 1.34.
test.c:3: invalid return type given for constructor
test.c:3: Segmentation violation
Program c++ got fatal signal 11.

There's a typo in cplus-decl.c:

*** cplus-decl.c.orig	Sun Mar 26 07:49:13 1989
--- cplus-decl.c	Sun Mar 26 08:08:38 1989
***************
*** 3705,3711 ****
  	   && TYPE_MAIN_VARIANT (type) != TYPE_POINTER_TO (ctor_return_type))
      {
        error ("invalid return type given for constructor");
!       type = TYPE_POINTER_TO (ctype);
      }
  
    ctype = NULL_TREE;
--- 3705,3712 ----
  	   && TYPE_MAIN_VARIANT (type) != TYPE_POINTER_TO (ctor_return_type))
      {
        error ("invalid return type given for constructor");
!       type = TYPE_POINTER_TO (ctor_return_type);
!       explicit_int = -1;
      }
  
    ctype = NULL_TREE;
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