🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

2 total messages Started by David Hinman Thu, 27 Jul 1989 21:47
g++ 1.35.0, sun3-os4; signal 11 while compiling
#301
Author: David Hinman
Date: Thu, 27 Jul 1989 21:47
47 lines
1917 bytes
When I compile the following test program, I get a segmentation violation.
When the structure declaration is removed from the class, the problem goes away.

>>> The code:
/*  g++ 1.35.0, sun3-os4; signal 11 while compiling */
class ObjectTable 
	{
	
private:

	typedef struct ote_struct
		{
		int x;
		int y;
		} ObjectTableElement;

	ObjectTableElement ote;

	ObjectTableElement* index() { return &ote; }

public:
	void     setNBytes();
	};

>>> The compiler messages:
imposter hinman> g++ -v -g -c test23.C
g++ version 1.35.0
 /usr/local/pkg/gnu/compilers/sun3new/gcc-cpp -+ -v -undef -D__GNU__ -D__GNUG__
-D__cplusplus -Dmc68000 -Dsun -Dunix -D__mc68000__ -D__sun__ -D__unix__ -D__HAVE
_68881__ -Dmc68020 test23.C /tmp/cca18439.cpp
GNU CPP version 1.35
 /usr/local/pkg/gnu/compilers/sun3new/gcc-cc1plus /tmp/cca18439.cpp -quiet -dump
base test23.C -noreg -version -G -o /tmp/cca18439.s
GNU C++ version 1.35.0 (68k, MIT syntax) compiled by GNU C version 1.35.
In method struct ote_struct *ObjectTable::index ():
test23.C:14: Segmentation violation
g++: Program cc1plus got fatal signal 11.
imposter hinman>

>>> The pat on the back:
I'm a happy user of FSF products; thanks for sharing your software!

Dave Hinman                         
Samsung Software America           (508) 685-7200 ext. 124
One Corporate Drive                hinman@ginosko.samsung.com
Andover, MA 01810                  uunet!ginosko!hinman
g++ 1.35.0, sun3-os4; signal 11 while compiling
#303
Author: Michael Tiemann
Date: Fri, 28 Jul 1989 04:36
42 lines
1513 bytes
    When I compile the following test program, I get a segmentation violation.
    When the structure declaration is removed from the class, the problem goes away.

    >>> The code:
    /*  g++ 1.35.0, sun3-os4; signal 11 while compiling */
    class ObjectTable 
	    {

    private:

	    typedef struct ote_struct
		    {
		    int x;
		    int y;
		    } ObjectTableElement;

	    ObjectTableElement ote;

	    ObjectTableElement* index() { return &ote; }

    public:
	    void     setNBytes();
	    };

Fix: in cplus-search.c (dfs_pushdecls):

  for (fields = TYPE_FIELDS (type); fields; fields = TREE_CHAIN (fields))
    {
      /* Unmark so that if we are in a constructor, and then find that
	 this field was initialized by a base initializer,
	 we can emit an error message.  */
      TREE_USED (fields) = 0;
      if (DECL_ANON_UNION_ELEM (fields))
	{
	  dfs_pushdecls (TREE_TYPE (fields));
	  continue;
	}
+      if (TREE_CODE (fields) == TYPE_DECL)
+	continue;

Michael
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