How About #define foo foo

tanner at ki4pv.UUCP tanner at ki4pv.UUCP
Fri Feb 13 11:33:57 AEST 1987


It is interesting to note that some progs notice constructions where
a macro is defined to be itself, such as csh noting "alias foo foo".

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.
-- 
<std dsclm, copies upon request>	   Tanner Andrews



More information about the Comp.lang.c mailing list