Thread View: gnu.g++.bug
1 messages
1 total messages
Started by Ron Guilmette
Fri, 28 Apr 1989 16:18
BUG(s) in GCC/G++ 1.34/1.34.1
Author: Ron Guilmette
Date: Fri, 28 Apr 1989 16:18
Date: Fri, 28 Apr 1989 16:18
35 lines
1531 bytes
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
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