[LLVMdev] Apple's GCC and .s/.S files in llvm-test (fwd)

Dale Johannesen dalej at apple.com
Tue Mar 25 11:18:43 PDT 2008


On Mar 25, 2008, at 11:04 AM, David Vandevoorde wrote:

>
> On Mar 25, 2008, at 1:08 PM, Dale Johannesen wrote:
>>
>> On Mar 24, 2008, at 3:18 PM, David Vandevoorde wrote:
>>
>>>
>>> On Mar 24, 2008, at 5:40 PM, Dale Johannesen wrote:
>>> [...]
>>>> I don't see a good way to do
>>>> full-line comments that works both if you run the preprocessor and
>>>> if
>>>> you don't.
>>>
>>>
>>> Could you use "##" instead of "#"?
>>
>> Pragmatically, that works (as I'm sure you know).   Digging into the
>> legalities of C99 I'm not sure that it's guaranteed to work, though.
>> Unknown directives actually match the "non-directive" case in the
>> grammar in 6.10; while nothing is said anywhere about semantics  
>> that I
>> can find, I'm not sure why gcc feels this should be a hard error at
>> all....
>
> "##" is a punctuator (6.4.6) and therefore a preprocessing token of
> its own (6.4/1).
>
> A line that starts with "##" is therefore a text-line in 6.10/1
> parlance (i.e., it doesn't match the "# non-directive" rule), and so
> yes, I think it's guaranteed to work on the preprocessor side of
> things.  (I know next to nothing about the assembler side of things.)

Ah right, ## is still a token although it can appear only in  
restricted places...ok, now I like this.  This is documented to work  
in the assembler, so it looks good.  Thanks.





More information about the llvm-dev mailing list