[cfe-dev] [llvm-dev] problem (and fix) with -fms-extensions

Reid Kleckner via cfe-dev cfe-dev at lists.llvm.org
Wed May 17 15:55:06 PDT 2017


On Wed, May 17, 2017 at 3:22 PM, Marc Espie <espie at nerim.net> wrote:

> On Wed, May 17, 2017 at 01:01:07PM -0700, Reid Kleckner wrote:
> >
> >    I'd rather not add new pre-defined macros if we can avoid it. There
> are
> >    already too many. You can probably detect this situation with:
> >    #if defined(_MSC_EXTENSIONS) && !defined(_WCHAR_T_DEFINED)
> >
> Was this added recently ?
>
> There is no _MSC_EXTENSIONS in the clang I'm using...
>

Looks like we only define it for Windows targets.

How about __is_identifier?

$ cat t.cpp
#if !__is_identifier(__wchar_t)
#error "have __wchar_t"
#else
#error "no __wchar_t"
#endif

$ clang --target=x86_64-linux -c t.cpp
t.cpp:4:2: error: "no __wchar_t"
#error "no __wchar_t"
 ^
1 error generated.

$ clang --target=x86_64-linux -c t.cpp  -fms-extensions
t.cpp:2:2: error: "have __wchar_t"
#error "have __wchar_t"
 ^
1 error generated.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170517/6aa3d7dc/attachment.html>


More information about the cfe-dev mailing list