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

Richard Smith via cfe-dev cfe-dev at lists.llvm.org
Thu May 18 13:27:48 PDT 2017


On 18 May 2017 9:59 am, "Marc Espie via cfe-dev" <cfe-dev at lists.llvm.org>
wrote:

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.


We reserve the right to provide __wchar_t in modes other than
-fms-extensions in future, or to sometimes not provide it in that mode, so
using _MSC_EXTENSIONS for this is simply a mistake.

If you want to detect whether we provide a builtin __wchar_t,
__is_identifier is the mechanism we provide for that. It doesn't make sense
for us to add another.

_______________________________________________
cfe-dev mailing list
cfe-dev at lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170518/eff8e642/attachment.html>


More information about the cfe-dev mailing list