🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #2583

The Preprocessor and tokens

#2583
From: cmills
Date: Mon, 25 Mar 1991 02:37
24 lines
1117 bytes
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
Technical Details
Message-ID: <3137@wyse.wyse.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!ames!vsi1!wyse!wyse.wyse.com!cmills

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!ames!vsi1!wyse!wyse.wyse.com!cmills
From: cmills@wyse.wyse.com
Newsgroups: comp.std.c
Subject: The Preprocessor and tokens
Keywords: cpp
Message-ID: <3137@wyse.wyse.com>
Date: 25 Mar 91 02:37:10 GMT
Sender: news@wyse.wyse.com
Reply-To: cmills@wyse.wyse.com ()
Organization: Wyse Technology
Lines: 24