Recursive Definitions: Trouble or Bad news?
david.f.prosser
dfp at cbnewsl.ATT.COM
Fri Oct 13 05:37:36 AEST 1989
In article <7657 at cdis-1.uucp> tanner at cdis-1.uucp (Dr. T. Andrews) writes:
>I should be interested to know the latest ANSI wisdom on a construct
>requesting that token BLUNGE be replaced by itself:
> #define BLUNGE BLUNGE
When BLUNGE is replaced, the attempted recursion is detected and
the macro is left unchanged. A more complicated example would be
#define A B
#define B A
A
in which A is replaced by B and during the rescan B is replaced by A.
The next rescan detects the recursion, and this A is unreplaced and
is the result.
Yes, this implies that the macro replacement algorithm must keep track
of potentially lots of information.
Dave Prosser ...not an official X3J11 answer...
More information about the Comp.lang.c
mailing list