declaring routines which return function pointers

Ron Natalie <ron> ron at brl-tgr.ARPA
Tue Dec 18 02:35:58 AEST 1984


> I have a routine which resembles the following:
> 
> 	int (*f)();
> 	int fa(), fb();
> 
> 	fa() {
> 		f = fb;
> 		return(f);
> 	}
> 
> 	fb() {
> 	}
> 
> The problem with the above is that lint complains about an illegal combin-
> ation of a pointer with an integer in the 'return' statement.  I have tried
> various casts and function declarations to try to satisfy lint, but none of
> them have worked.  Does anybody know what I should do to keep lint happy?
> 
> 					Robert Lake (alberta!lake)
> 					University of Alberta

Have you tried declaring fa as a function returning pointer to function?



More information about the Comp.lang.c mailing list