Macro names imbedded in pp-numbers [repost]

Norman Diamond diamond at csl.sony.co.jp
Mon Nov 20 12:51:46 AEST 1989


I posted:

>>I will have to add code to my scanner, and slow it down, so that
>>it will not call the preprocessor if it finds a macro in the middle
>>of a pp-number.

In article <15217 at haddock.ima.isc.com> karl at haddock.ima.isc.com (Karl Heuer) writes:

>Why should it "find" a macro in the middle of a pp-number, any more than it
>should try to expand the substring "getc" in the token "fgetc"?

Because my scanner finds the hex number, and then finds the operator,
and then finds the macro.  My scanner does not look for pp-numbers.
(When it calls the preprocessor, the preprocessor looks for pp-numbers
internal to its own operation.)

In a related posting, I have already asked if it is really necessary to
give a warning when a part of the program is processed which depends on
undefined behavior.  I guessed no, because 2.1.1.2 (and various other
sections) do not say "constraints."  But Mr. Heuer says yes.  Why?
(I will have to add code to my scanner, and slow it down, so that
it will give a warning if it finds a macro in the middle
of a pp-number.)

-- 
Norman Diamond, Sony Corp. (diamond%ws.sony.junet at uunet.uu.net seems to work)
  Should the preceding opinions be caught or     |  James Bond asked his
  killed, the sender will disavow all knowledge  |  ATT rep for a source
  of their activities or whereabouts.            |  licence to "kill".



More information about the Comp.std.c mailing list