Paul Krill
Editor at Large

Microsoft Visual Studio beefs up support for C language

news
Sep 16, 20202 mins

C11 and C17 become supported C language versions starting with Visual Studio 2019 16.8 Preview 3

cow inspect look closely insight future
Credit: Thinkstock

Microsoft’s Visual Studio IDE has added support for the C11 and C17 C language standards, thus expanding the IDE’s previously limited support for C. C11 and C17 become supported language versions starting with Visual Studio 2019 16.8 Preview 3, which was released September 14.

For years, Visual Studio has limited C support to whatever was required for the C++ language, which was built as an extension of C. Now, a conformant, token-based preprocessor has been added to the compiler. Two compiler switches, /std:c11 and /std:c17, were added to provide conformance to the latest ISO C standards.

C11 and C17 functionalities are supported such as _Pragma, restrict, and Static_assert. IntelliSense can work with these features by using a .c file extension for source files or the /TC compiler switch to enable syntax highlighting for C code. However, IntelliSense highlighting is currently available for keywords only, not macros introduced by standard headers. A future release will fix this.

With the inclusion of the token-based conformant preprocessor, the two new C compiler switches imply /Zc:preprocessor. Developers who want to use the traditional character-based preprocessor alongside C11 or C17 will need to pass in the /Zc:preprocessor- compiler switch.

Microsoft described C17 as a bug fix release of ISO C. The only differences between the C11 and C17 versions are the _STDC_version macro in C17. While Visual Studio offers no support for C11 optional features, Microsoft plans to add the most impactful optional features in future releases. Atomic and threading support are on the product roadmap. 

To use C11 and C17 in programs, developers must have the latest Insider Preview Windows SDK updates to work with the conforming preprocessor and the new Universal C runtime. Developers can create a free Microsoft account (https://signup.live.com) and then opt into the Insider program. Microsoft has posted a set of instructions for getting started with C11 and C17.

Visual Studio 2019 16.8 Preview 3 also offers improved support for C++ 20 across the compiler, standard library, and IDE. Modules, concepts, coroutines, and some ranges can be used in the same project.

Paul Krill

Paul Krill is editor at large at InfoWorld. Paul has been covering computer technology as a news and feature reporter for more than 35 years, including 30 years at InfoWorld. He has specialized in coverage of software development tools and technologies since the 1990s, and he continues to lead InfoWorld’s news coverage of software development platforms including Java and .NET and programming languages including JavaScript, TypeScript, PHP, Python, Ruby, Rust, and Go. Long trusted as a reporter who prioritizes accuracy, integrity, and the best interests of readers, Paul is sought out by technology companies and industry organizations who want to reach InfoWorld’s audience of software developers and other information technology professionals. Paul has won a “Best Technology News Coverage” award from IDG.

More from this author