Visual Studio 2017 does not supportC11 new feature _Generic

天大地大妈咪最大 提交于 2019-12-02 00:27:23

Visual Studio 2017 does not support any C11 features. You can plug Intel C compiler into Visual Studio (which supports C11) or use Clang or Gcc.

Quora answer:

  • To your Visual Studio add the inbuilt CLANG support
  • Create new project
  • In project properties (General) for “Platform Toolset” select “Visual Studio 2017 - Clang with Microsoft CodeGen (v141_clang_c2)
  • In C/C++ “Language” section open the “C language” standard list , where you will find all the C standards relevant todayL C89, C99, C11 …select the one you wish

After this (same as ever) VS2017 will compile files with “.c” extension as C, and “.cpp” extension as C++.

Do not forget that one can change the properties on the per file basis too.

This is because Microsoft has never prioritized conformance to the C language standard. Over the last 20 years or so, their main focus has been C++. So Visual Studio is to be regarded as a C++ compiler.

In "C mode", it still has questionable compliance towards the first C standard C90. It took them forever to make an attempt to get C99 compliance, they made some effort towards that only in recent years. It is still not fully C99 compliant either. As far as I know, there are no plans for C11 or C17 compliance.

So if standard conformance is important to you, you must look for another C compiler.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!