C-Debug package ... (a la "context-independent macros")

Kevin Szabo ksbszabo at wateng.UUCP
Wed Jan 30 05:07:53 AEST 1985


In article <33 at daisy.UUCP> pkl at daisy.UUCP (Peter K. Lee) writes:
>	# define macro(args)\
>		if (1) {\
>			/* macro body */\
>		}\
>		else

I am also not going to use Peter's suggestion because it too can cause
un-obvious behavior, but this time if the user makes a small syntax
error. Suppose I forget the semicolon when I call the macro?

		macro( args )
		next_statment;

Voila! next_statement is NEVER called because it is gobbled up in
the `else' clause of the expanded macro. Yuck...that would take hours
to find.

I also find the macro definition hard to read...whenever I see an
`else' I expect it to be controlling something. Very confusing.

				Kevin
-- 
Kevin Szabo  watmath!wateng!ksbszabo (U of Waterloo VLSI Group, Waterloo Ont.)



More information about the Comp.lang.c mailing list