Solution to "A C Puzzle" of 12/12/83

eric at wucs.UUCP eric at wucs.UUCP
Thu Mar 22 11:32:07 AEST 1984


[Elrod of Melvinbone, and his trusty sword Linesucker...]


The varargs(3) stuff is particularly sensitive to this horseydoodoo.

Try passing a pointer to an integer function using varargs, and getting
it with a line such as

	int (*funcs)();

	...

	funcs=va_arg(ap,int (*p)());

The 4.2 BSD (Bugs Surface Daily) compiler does the Technicolor Yawn
on this one.  The fix is FM as far as I can tell:

	typedef int (*pintf)();

	pintf func;

	func=va_arg(ap,pintf);


works just fine.  As Bill the Cat would say, " GACK! ".

eric
-- 
..!ihnp4!afinitc!wucs!eric



More information about the Comp.lang.c mailing list