[cfe-commits] Patch to make clang compile and work on Windows using MSVC8

Steve Naroff snaroff at apple.com
Tue Sep 4 19:42:26 PDT 2007


On Sep 4, 2007, at 6:29 PM, Hartmut Kaiser wrote:

> Chris,
>
>>>>>> It looks like it might just be trailing whitespace removed.
>>>>>> Is this intentional or just something extraneous in the patch?
>>>>>
>>>>> This was intentionally. AFAIK a backslash/newline should be
>>>> recognized
>>>>> as a line continuation only if there is no whitespace in between
>>>>> those.
>>>>
>>>> This is a well known (and long-debated) GCC extension that we're
>>>> intentionally compatible with.
>>>
>>> Understand. Can you (optionally) switch that off, just to be 100%
>>> Standards comformant?
>>
>> I believe we already emit "backslash and newline separated by space"
>> as a warning.  I would be fine with changing it to an
>> extension warning (visible with -pedantic). Is this what you mean?
>
> I'm not sure I understand the conventions applied for Clang, so please
> excuse my ignorance.
>
> IMHO a tool like Clang should be absolutely Standards conformant by  
> default.

clang tends to default to gcc conformance.

-pedantic will warn about gcc extensions.
-pedantic-error considers gcc extensions hard errors. If you want  
standards conformance, this is probably the switch you are interested  
in.

At the moment, neither of these switches are enabled by default. As  
clang matures, I'm sure we will consider changing the default (based  
on feedback).

> If there are extensions supported these should be enabled  
> explicitely if
> needed. In this context I'ld report an _error_ on "backslash and  
> newline
> separated by space" and allow to bring that down to an (pedantic)  
> warning
> using a special --allow_gcc_extensions switch only. But YMMV...
>

 From my perspective, this is a policy decision (that I don't have a  
strong opinion on). In general, I don't think a low level tool (like  
clang) should be in the business of setting policy. Policy can be set  
by local build systems (make, jam, ant, etc.) and integrated  
development environments (Xcode, etc.).

snaroff

> Regards Hartmut
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits




More information about the cfe-commits mailing list