[cfe-dev] test/Sema/typedef-redef.c failure

Nuno Lopes nunoplopes at sapo.pt
Tue Jun 24 16:32:29 PDT 2008


Uhm, so the reason why clang isn't using its own stddef.h is because 
GetMainExecutable() is returning 'clang' only. It then tries to access the 
/Headers directory and fails.
This issue has already been reported here for Debian systems, but I confirm 
this is also an issue with Gentoo stable (glibc 2.6.1).

Nuno


----- Original Message -----
> No, I haven't patched the clang driver. I'm now using the CPATH 
> environment
> variable. Anyway clang was supposed to use its own stddef.h...
> Nuno
>
>
> ----- Original Message -----
>> I'm not seeing this.  Is /usr/lib/gcc/i686-oc-linue-gnu/4.1.2 included 
>> in
>> the driver (clang.cpp) as a system header?
>>
>> For example, do you have a line like:
>>
>>     // Fedora 8
>>     AddPath("/usr/lib/gcc/i386-redhat-linux/4.1.2/include", System,
>>             false, false, false, Headers);
>>
>> If you don't, stddef.h might not be included as a system header, 
>> although
>> I'm not certain why clang would be able to find stddef.h.
>>
>> On Jun 19, 2008, at 3:17 PM, Nuno Lopes wrote:
>>
>>> Hi,
>>>
>>> Is anyone else seeing a failure in the Sema/typedef-redef.c test?
>>> I'm getting this output:
>>>
>>> $ clang -fsyntax-only test/Sema/typedef-redef.c
>>> test/Sema/typedef-redef.c:4:23: error: redefinition of 'size_t'
>>> typedef unsigned long size_t;
>>>                      ^
>>> In file included from test/Sema/typedef-redef.c:3:
>>> /usr/lib/gcc/i686-pc-linux-gnu/4.1.2/include/stddef.h:214:23: error:
>>> previous definition is here
>>> typedef __SIZE_TYPE__ size_t;
>>>                      ^
>>> 2 diagnostics generated.
>>>
>>> Notice that it is including gcc's stddef.h instead of clang's. (btw
>>> __SIZE_TYPE__ is defined as 'long unsigned int').
>>>
>>> Nuno 




More information about the cfe-dev mailing list