How About #define foo foo

meissner at dg_rtp.UUCP meissner at dg_rtp.UUCP
Wed Feb 25 01:01:27 AEST 1987


In article <6938 at ki4pv.UUCP> tanner at ki4pv.UUCP writes:
> 
> Would it be desirable for the pre-processor to do something similar,
> so that the following construction might work?
> 
> #ifndef	foo
> typedef	int	(*foo)();	/* my fancy type */
> #define	 foo	foo		/* remember that we know it */
> #endif
> 
> Just curious.  Compiler here blows out on the above (expansion too
> big), but I'd be interested to hear of other reactions to it.

This is the proposed ANSI draft.  The rationale for it is to allow a macro
function which calls the real function by the same name.  Reiser based
C preprocessors generally blow up on this.
-- 
	Michael Meissner, Data General	Uucp: ...mcnc!rti-sel!dg_rtp!meissner

It is 11pm, do you know what your sendmail and uucico are doing?



More information about the Comp.lang.c mailing list