Macro names imbedded in pp-numbers [repost]

Karl Heuer karl at haddock.ima.isc.com
Sat Nov 18 13:51:43 AEST 1989


In article <1643 at crdos1.crd.ge.COM> davidsen at crdos1 (bill davidsen) writes:
>	#define F_LIMIT	0x14e
>	top3 = triad(bset, F_LIMIT+3);
>The last is interesting, because if F_LIMIT+3 is taken as a float
>value, and if there is a prototype...

As Doug has already pointed out, this is not a problem because there is a
token delimiter folling F_LIMIT.  Besides, there are no hex-floats in ANSI C
(nor in any extension that I'm aware of); "0x14e+3" is a pp-token that cannot
be resolved into a real token.  (As is also, for example, "018" or "4s".)  If
the Committee had tried to make this a legal token, it would have been a Quiet
Change--and *that* would have been a lot more controversial!

>I'm really hoping that this could be treated as a wording change, not
>requiring a vote, but I suspect it is too big for that.

The guiding principle is that a change that reflects the Committee's original
intent is editorial, one that does not is substantive.  Unfortunately, this
behavior appeared as an explicit example in the Rationale, so it's hard to
argue that the Committee didn't intend it.

Karl W. Z. Heuer (ima!haddock!karl or karl at haddock.isc.com), The Walking Lint



More information about the Comp.std.c mailing list