Of Standards and Inventions: A Cautionary Tale
Doug Gwyn
gwyn at brl-smoke.ARPA
Tue Apr 12 22:41:46 AEST 1988
In article <1526 at dataio.Data-IO.COM> bright at dataio.UUCP (Walter Bright) writes:
-In article <7637 at brl-smoke.ARPA> gwyn at brl.arpa (Doug Gwyn (VLD/VMB) <gwyn>) writes:
-<In article <1525 at dataio.Data-IO.COM< bright at dataio.UUCP (Walter Bright) writes:
-<<I don't understand why ANSI C doesn't allow casts and sizeofs in
-<<preprocessor expressions. ...
-<<In my compiler, they follow the same rules because it's the same code!
-<We didn't want to mandate that the preprocessor be integrated into the
-<language parser proper. I agree that the language would be nicer if
-<it WERE so integrated, but for historical reasons it wasn't.
-What I proposed didn't mandate this. What I proposed was to COPY (or use
-#ifdef's) the code for the expression parser into the preprocessor code.
Ah, one could indeed duplicate the portion of the compiler that deals
with types in the preprocessor, which would be required in order to
handle sizeof() properly there, but that's what we didn't want to
require as I recall. At that point one might as well integrate the
preprocessor into the lexer instead of duplicating all that code.
-#if sizeof(long) != sizeof(int)
Yes, I've wanted to be able to do this too.
More information about the Comp.lang.c
mailing list