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

Marc Espie via cfe-dev cfe-dev at lists.llvm.org
Thu May 18 09:59:08 PDT 2017


On Thu, May 18, 2017 at 09:49:17AM -0700, Reid Kleckner wrote:
>    So, we actually have documentation on this, and __wchar_t is the
>    example use case:
>    [3]https://clang.llvm.org/docs/LanguageExtensions.html#is-identifier
>    Please just use it, it works.
>    I do not want to define _MSC_EXTENSIONS more than we already do, and I
>    don't think we should add more pre-defined macros when we already have
>    these nicely factored feature test macros that don't pollute the global
>    namespace. The "simple solution" is not a good solution.
>    I believe our use of _MSC_EXTENSIONS is wrong anyway. It is controlled
>    by MSVC's /Ze and /Za flags, which do not relate to our -fms-extensions
>    flag.
> 
How about you actually read my problem ?

this is not what I'm trying to solve.

The error I get is:
/usr/include/machine/_types.h:132:15: error: cannot combine with previous 'int'
declaration specifier
      typedef int                     __wchar_t;


and it's *because* -fms-extensions does define __wchar_t.

A solution is nowhere as short as the fragment you quote from the documentation.



More information about the cfe-dev mailing list