struct declarations in dpANS C

David Keppel pardo at june.cs.washington.edu
Sat Oct 22 01:16:10 AEST 1988


I have code of the form:

    typedef void (*rtl_fp)( struct save_t *, int n,  rtl_t *curr );
    typedef struct everyn_t {
	int		n;	
	rtl_fp	func;	
    } everyn_t;

In normal use the "struct save_t" is declared in another file that
depends on declarations in this (.h) file.  Even though struct save_t
is defined before the rtl_fp is used, this declaration still causes
the compiler to emit warnings about "argument passing between
incomopatible pointer types" unless I precede the function declaration
with

    struct save_t;

(In which case the compiler notes that there is an "empty
declaration".)  Question: is this proper behavior?

	;-D on  ( Prototypical Problematical Pterodactyl )  Pardo
-- 
		    pardo at cs.washington.edu
    {rutgers,cornell,ucsd,ubc-cs,tektronix}!uw-beaver!june!pardo



More information about the Comp.std.c mailing list