🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

2 total messages Started by Ron Guilmette Sun, 22 Jan 1989 21:28
BUG in G++ 1.32.0 - c++ get segmentation violation
#1643
Author: Ron Guilmette
Date: Sun, 22 Jan 1989 21:28
21 lines
1222 bytes
I thought that I would try something tricky and see if I could
redefine the sizeof operator.  I ran the following code thru
G++ 1.32.0 and it got a segmentation violation in c++.

There are two issues here.  First, it's obvious that the segmentation
violation shouldn't occur.  Second, I think that allowing the sizeof
operator to be redefined would be a nice feature, and consistant
with the general philosophy of letting all operators be redefined.

What does cfront (1.2/2.0) do with this code?

class test {
public:
	virtual operator sizeof();
};

// Ron Guilmette  -  MCC  -  Experimental (parallel) Systems Kit Project
// 3500 West Balcones Center Drive,  Austin, TX  78759  -  (512)338-3740
// ARPA: rfg@mcc.com
// UUCP: {ihnp4,seismo,ucb-vax,gatech}!cs.utexas.edu!pp!rfg
Re: BUG in G++ 1.32.0 - c++ get segmentation violation
#1649
Author: Doug Schmidt
Date: Tue, 24 Jan 1989 00:34
42 lines
1933 bytes
In article <8901222128.AA01734@riunite.aca.mcc.com> rfg@MCC.COM (Ron Guilmette) writes:
[ g++ 1.32 give fatal signal for: ]
>
>class test {
>public:
>	virtual operator sizeof();
>};
>

Here is a quick patch for this problem:

----------------------------------------
*** cplus-decl.c.~1~	Sat Jan 21 20:36:43 1989
--- cplus-decl.c	Mon Jan 23 16:27:39 1989
***************
*** 4407,4414 ****
            {
              if (virtualp)
                {
!                 error ("virtual non function declaration for field `%s'",
!                        IDENTIFIER_POINTER (declarator));
                  virtualp = 0;
                }
            }
--- 4407,4417 ----
            {
              if (virtualp)
                {
!                 if (declarator) 
!                   error ("virtual non function declaration for field `%s'",
!                           IDENTIFIER_POINTER (declarator));
!                 else
!                   error ("virtual non function declaration encountered");
                  virtualp = 0;
                }
            }
----------------------------------------
--
BBoard-ID: 616
BB-Posted: Sat, 21 Jan 89 23:59:19 PST
Received: from [128.195.0.50] by ICS.UCI.EDU id am00547; 21 Jan 89 23:57 PST
Received: from kl.sri.com by PARIS.ICS.UCI.EDU id aa17425; 21 Jan 89 0:28 PST
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