Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the official status of C99 support in VS2013?

Tags:

I see that VS2013 added support for a large number of major core language features of C99. Now it supports compound literals, designated initializers, variadic macros, interleaved declarations and statements just to name a few.

This indicates that VS developers made serious steps towards C99 support in Visual Studio. Yet, some of these features are not part of C++ language, which appears to be a notable deviation from the previously announced development strategy (e.g. "VS C compiler will only support those C99 features that are also a part of C++").

So, is there any official or semi-official word on what's going on? I don't seem to be able to find anything definitive on the Net. Were these C99 features officially announced? Is there any commitment to continued C99 support in VS? Or is this just some sort of "rogue" unofficial development?

like image 337
AnT Avatar asked Jan 07 '15 18:01

AnT


People also ask

Does Visual Studio use C99?

By default, Microsoft's Visual Studio C Compiler doesn't follow the C99 standard. If you're using Visual Studio, you can make the transition process to Unix for the Lab Assignments easier by performing the following steps.

Does Visual Studio support C11?

Support for C11 and C17 standards is available in Visual Studio 2019 version 16.8 and later.

What version of C does Visual Studio use?

In versions of Visual Studio 2019 before version 16.11, /std:c++latest is required to enable all the compiler and standard library features of C++20. For a list of supported language and library features, see What's New for C++ in Visual Studio.

Does MSVC support VLA?

Astute readers will note that VLAs are also not supported.


1 Answers

There are a few public official discussions of this from Microsoft developers, the C++ Conformance Roadmap which says:

Herb also announced that, in response to customer requests, the RTM version will also include a few tactical C99 language extensions when compiling C code, so that some popular community libraries (including FFmpeg) will now be able to compile with Visual C++ 2013.

So this has official support but is strategic, from what I can tell form the following articles more support will have to compete with other priorities.

We have the C++11/14 STL Features, Fixes, And Breaking Changes In VS 2013 Blog entry by STL:

Additionally, some C99 Core Language features will be implemented in 2013 RTM:

  • C99 _Bool

  • C99 compound literals

  • C99 designated initializers

  • C99 variable declarations

and C99 library support in Visual Studio 2013 blog entry by Pat Brenner which opens with:

In this blog post I want to share some information about the C99 support added to the C run-time library in Visual Studio 2013.

and ends with:

We know that this is not complete support for the C99 library functions. To the best of our understanding, the missing pieces are these:

  • The tgmath.h header is missing. C compiler support is needed for this header. Note that the ctgmath header was added—this is possible because that header does not require the tgmath.h header—only the ccomplex and cmath headers.
  • The uchar.h header is missing. This is from the C Unicode TR. Several format specifiers in the printf family are not yet supported.
  • The snprintf and snwprintf functions are missing from stdio.h and wchar.h.

which is somewhat more interesting since STL actively addresses comments to the blog and they are hard to summarize but we can see future additions will depend on competing priorities.

Thanks to cremno for pointing out another blog post C Runtime (CRT) Features, Fixes, and Breaking Changes in Visual Studio 14 CTP1 which says:

In the Visual Studio "14" CTP we have fully implemented the C99 Standard Library, with the exception of any library features that depend on compiler features not yet supported by the Visual C++ compiler (notably, <tgmath.h> is not implemented). There are undoubtedly some remaining conformance issues--we know of a few, including that _Exit is missing and wcstok has the wrong signature, and we are working to fix these. If you find a bug or a missing feature, please do report it on Microsoft Connect. If you report bugs now, there is a very good chance that we'll be able to fix them before RTM.

and has a lot of details that can not be easily summarized.

like image 163
Shafik Yaghmour Avatar answered Oct 01 '22 04:10

Shafik Yaghmour