🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.g++.bug
Article #1926

BUG(s) in GCC/G++ 1.34/1.34.1

#1926
From: Ron Guilmette
Date: Fri, 28 Apr 1989 16:18
35 lines
1531 bytes
Should the scope of a typedef'd name extend to the typedef itself?

How (if at all) can you use ANSI function prototypes to declare
a pointer-to-function type where the function can take a pointer
to itself as an argument?

The following code is rejected with errors on each of the two typedefs
by both GCC and G++ (1.34 and 1.34.1 respectively).  The specific
errors issued are radically different however.

Are the errors legitimate?  Are these errors due to bugs in the
compilers or bugs in the ANSI C standard?  Both?  Neither?

--------------------------------------------------------------------
typedef void (*recursive_func) (int i, recursive_func f);

typedef struct {
		recursive_struct* f1;
	} recursive_struct;

void my_recursive_func (int i, recursive_func f)
{
}

void test ()
{
	my_recursive_func (99, my_recursive_func);
}
---------------------------------------------------------------------

// Ron Guilmette  -  MCC  -  Experimental Systems Kit Project
// 3500 West Balcones Center Drive,  Austin, TX  78759  -  (512)338-3740
// ARPA: rfg@mcc.com
// UUCP: {rutgers,uunet,gatech,ames,pyramid}!cs.utexas.edu!pp!rfg
Technical Details
Message-ID: <8904281618.AA06876@riunite.aca.mcc.com>
Path: arc1-ca.pugleaf.net!utzoo!telly!ddsw1!lll-winken!uunet!tut.cis.ohio-state.edu!MCC.COM!rfg

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!ddsw1!lll-winken!uunet!tut.cis.ohio-state.edu!MCC.COM!rfg
From: rfg@MCC.COM (Ron Guilmette)
Newsgroups: gnu.g++.bug
Subject: BUG(s) in GCC/G++ 1.34/1.34.1
Message-ID: <8904281618.AA06876@riunite.aca.mcc.com>
Date: 28 Apr 89 16:18:48 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 35