"Richard Heathfield" <> a écrit dans le message de news:
...
> Charlie Gordon said:
>
>> "Richard Heathfield" <> a écrit dans le message de
>> news: ...
>
> <snip>
>>>
>>> Two string literals, yes. Whether one or the other or neither or both is
>>> a macro is neither here nor there, but they must both be string
>>> literals if you want the preprocessor to glue them together for you.
>>
>> This is a late reply, but contrary to popular belief, it is not the
>> preprocessor that glues adjacent string literals together, but the
>> compiler in translation phase 6 (6.4.5p4).
>
> It's the implementation, in fact: and phase 6 comes *before* translation
> (which happens in TP7), so it's still *pre*-processing. I have read
> 6.4.5(4) and failed to find any mention of a compiler.
All C preprocessors I have tested leave the adjacent strings intact. It
does not prove my point beyond common sense understanding of the split
between "preprocessing" and "compiling".
Translation phases are described in c99 5.1.1.2: it is clear that
translation phase 4 is included in the "preprocessing". Translation phase 5
would have to be reverted for "preprocessing output" to be produced. I
think it implies that "preprocessing" covers phases 1 through 4, but
excludes phases 5 and 6, but it would not break much to include them and go
through extra work to produce parsable output where adjacent string literals
have been concatenated. It is just not what compiler writers seem to
choose.
--
Chqrlie.