[cfe-dev] RFC: Clang and libstdc++ versions, string.h and cstring conflicts, and glibc patches.

Brooks Moses bmoses at google.com
Fri Aug 30 12:10:18 PDT 2013




On 08/29/2013 07:40 PM, G M wrote:
> Is that another variant of the problem I was seeing compiling the
> program below?
> See my earlier message with the subject: clang and gcc -O3 bug amongst
> other issues?
> and Howard's comments of _WCHAR_H_CPLUSPLUS_98_CONFORMANCE_ on the
> message I mentioned.
>
> Is this related?

Yes, I believe that's essentially the same issue -- glibc has the C++ 
versions of the wcschr function (when GCC > 4.4) just like the functions 
in cstring.

I would guess your problem is that the Windows C library, much like 
glibc when compiled with GCC > 4.4, defines the correct C++ prototypes 
-- but that libc++ doesn't recognize that it's doing so.  The bug 7983 
that I mentioned has a little more discussion of what was happening with 
glibc in that case.

The fix is presumably similar -- either define the 
CPLUSPLUS_98_CONFORMANCE macros somewhere, or add a clause to the checks 
for them that also checks for the relevant Windows C library.

- Brooks






More information about the cfe-dev mailing list