The Preprocessor and tokens

cmills at wyse.wyse.com cmills at wyse.wyse.com
Mon Mar 25 12:37:10 AEST 1991


Whilst composing this year's entry for the IOCCC, I stumbled on some
ANSI wierdness and I was wondering, what does the Standard say about
constuctions like these:

#define _	+ 42

int j = 6_;

#define N	42

int k = 0x7e+N;

My compiler refuses to exapnd the macros in these cases.  Is there a good
reason for this (other than the preprocessor is a little easier to write
if you define [0-9][0-9a-zA-Z_]* as a token)?  I was under the impression
that the preprocessor and the compiler agreed on what constituted a
token...  (I find the second example particulary obfuscating :)

Do K&R compilers do it any differently?

BTW: The compiler in question is GCC.


					Chris Mills



More information about the Comp.std.c mailing list