Path: 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 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