Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/18/84; site cyb-eng.UUCP
Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!seismo!ut-sally!cyb-eng!bc
From: bc@cyb-eng.UUCP (Bill Crews)
Newsgroups: net.lang.c
Subject: Re: Is this correct action for the c compiler/preprocessor ??
Message-ID: <776@cyb-eng.UUCP>
Date: Wed, 6-Nov-85 21:56:58 EST
Article-I.D.: cyb-eng.776
Posted: Wed Nov  6 21:56:58 1985
Date-Received: Sun, 10-Nov-85 07:17:59 EST
References: <2667@brl-tgr.ARPA> <689@ucsfcgl.UUCP> <198@opus.UUCP>
Organization: Cyb Systems, Austin, TX
Lines: 39

> The question was whether the C preprocessor should substitute for an
> occurrence of a macro formal within a string within the body of the
> macro...
>
> > Being able to insert literal text in strings is very useful.
> 
> The fact that a feature is "useful" is not sufficient argument that it is
> correct.
> 
>                                                the definition that most of
> us use these days (K&R) says one thing:
> 	Text inside a string or a character constant is not subject to
> 	replacement.
> ...which is pretty explicit, but the compiler that a lot of us use
> substitutes inside strings.  I would like to have an authoritative
> definition and a correct compiler in accord with the definition.
> -- 
> Dick Dunn

As I read K&R, one could define the following:

#define	COMMENT	/*
#define	TNEMMOC	*/

COMMENT
	This tells all about my great program.
TNEMMOC

Not that I would particularly WANT to, but it DOES seem like C compilers
should allow this kind of thing if K&R allows it.  It is interesting that
this kind of thing never came up as a problem so long as de facto standard
Unix compilers were used.  Only when a lot of people started writing compilers
to the K&R specification was it discovered (or considered significant) that
Unix compilers didn't always conform either.  My guess is that the weight of
experience with Unix compilers is greater than K&R's these days.
-- 
	- bc -

..!{seismo,topaz,gatech,nbires,ihnp4}!ut-sally!cyb-eng!bc  (512) 835-2266