Is there any option to switch between C99 and C11 C standards in Visual Studio?

The only 'modes' supported by Visual C++ are: /std:c++14 mode for C++14 conformance (the default), /std:c++17 mode for C++17 support which is not quite complete as of VS 2017 (15.6). There is also a /std:c++latest mode which at some future point will include things in C++20. All of these should be combined with /permissive- for improved conformance.

To meet C++11 Standard Library conformance, Visual C++ has to support the C99 Standard Library, that's not the same thing as supporting C99 language conformance.

At some point to meet C++17 Standard Library requirements, Visual C++ will have to support the C11 Standard Library and again that's not the same thing as C11 language conformance.

See C++ Standards Conformance from Microsoft and C++11/14 STL Features, Fixes, And Breaking Changes In VS 2013

There is a comment thread in the post MSVC: The best choice for Windows where a Visual C++ project manager takes on the question of true 'C11' conformance.

Hi Onur,

C conformance is on our radar though we’re focusing on C++ conformance first.
We did some work in VS 2013 on C conformance, though we didn’t publicize it a lot. That work included:
– C99 _Bool
– C99 compound literals
– C99 designated initializers
– C99 variable declarations
We’re nearing the end of our C++ conformance work. One of the last items is a conforming preprocessor: a feature shared by C and C++. The preprocessor will mark the beginning of our C conformance push as well as the end of our C++98/11/14 conformance work.

Andrew

UPDATE: VS 2019 (16.8) will include /std:c11 and /std:c17 standards switches. See this blog post. Because the MSVC compiler does not support Variable-length Arrays (VLA) it does not claim C99 conformance. Note that these switches enable the new C99 preprocessor covered in this blog post.

VS 2019 (16.11) and VS 2022 also support /std:c++20. See this post.


Visual Studio is mostly a C++ compiler. In "C mode", it follows an ancient C standard from 1990.

Around 2013-2015, they made some effort to support not the current, but the previous C standard from 1999 ("C99"), some 16 years after its release. However, the work to conform to this standard has not been completed.

I believe the compiler also supports a few selected features of the current C language ("C11") such as the optional bounds-checking library. This standard has been available for 7 years but is not fully supported.

So if you need a conforming C language compiler, you should look for other alternatives.