[cfe-dev] CLang compiling windows.h from the Windows SDK

Francois Pichet pichet2000 at gmail.com
Mon Aug 9 21:37:58 PDT 2010


I raised Bug 7857 to explain the last issue preventing <Windows.h>
from compiling in C mode.

On Mon, Aug 9, 2010 at 11:43 PM, Francois Pichet <pichet2000 at gmail.com> wrote:
> wow I am impressed.. This indeed fix the typedef redefinition issue in
> windows.h.
> nice job.
>
> On Mon, Aug 9, 2010 at 11:14 PM, Eli Friedman <eli.friedman at gmail.com> wrote:
>> On Mon, Aug 9, 2010 at 7:19 PM, Francois Pichet <pichet2000 at gmail.com> wrote:
>>> You are right. MSVC doesn't allow typedef redefinition after all.
>>> Here is a code simplification of what is happening in windows.h
>>>
>>> struct A {
>>>        char a;
>>>        char b;
>>> };
>>>
>>> typedef int foo[1];
>>> typedef int foo[(long)&(((A *)0)->b)];
>>>
>>> clang will flag the second typedef as a redefintion. msvc and gcc don't.
>>
>> Nice testcase; fixed in r110651.
>>
>> -Eli
>>
>




More information about the cfe-dev mailing list