4 ms·
All that C++ support and they still don't support C99...
by CedarMadness 15y ago
All that C++ support and they still don't support C99...
- SamReidHughes 15y agoAnything to avoid tgmath.h.
- cygx 15y agoC11 added generic selections - tgmath.h is no longer magical...
- lambda 15y agoThey have explicitly stated that they have no interest in supporting C99, because they don't believe their users are asking for it, or their users would rather have new C++ features than new C features.
- xpaulbettsx 15y agoA lot of the C99 features like array initialization got sucked into C++11, and since the C "compiler" in MSVC is the C++ compiler, I think you'll probably get most of C99 for free.
- cygx 15y agoIf only that were true - however, some of the more interesting C99 and C11 features aren't part of C++11 as there are already C++ specific alternatives. Also, MS doesn't really have a good track record of backporting C++ features to C (mixing code and declarations, anyone?). If you want to write portable C code that works on at least *nix and Windows, either ignore MSVC (GCC works just fine on Windows via MinGW or Cygwin cross-compiler, as does Clang once you get it set up), or restrict yourself to the common subset of C99 and C++98...
- repsilat 15y agoOne thing I'm pretty jealous of is "Designated initialization" in C99: int whitespace[256] = { [' '] = 1, ['\t'] = 1, ['\h'] = 1, ['\f'] = 1, ['\n'] = 1, ['\r'] = 1 }; Very cool.
- pjmlp 15y agoMicrosoft does not care about C99. C++ is the official systems programming language in Windows, as has been communicated several times. C89 is good enough for writing device drivers, the only place Microsoft still advises to use C instead of C++. As for C99 support it is not as if Microsoft would be the only one not supporting it. http://en.wikipedia.org/wiki/C99#Implementations http://en.wikipedia.org/wiki/C99#Implementations To be honest I think C99 and C11 will most likely go unnoticed by all major compiler vendors.
- cygx 15y agoAre you looking at the same table I am looking at? All major compilers except MSVC 'mostly' support C99...
- pjmlp 15y agoYes I am. Have you validated what 'mostly' means? Let me tell you that each compiler manufacturer has a different dictionary to look up the meaning of 'mostly'. If a standard is not 100% implemented across compilers, no one can be sure to use it if portability is a concern. This is exactly like the time where most databases 'mostly' implemented the SQL '92 standard, and then the code had to be full with DB specific workarounds.
- cygx 15y ago> Have you validated what 'mostly' means? Have you? Real question - I'd be very interested in that. The list of (allegedly) fully compliant compilers is not very impressive (IBM, PGI, Sun), but in practice, you're aiming at C99 support to the level of GCC, which will get you - in addition to GCC and its (supposedly) drop-in replacement Clang - AMD and Intel (I think ICC has C99 support to GCC level, but there are probably discrepancies in the feature sets)...
- pjmlp 15y agoIn many of our projects we are not able to use GCC and are forced to use the official vendor's compiler for the platform. So it might be not that easy for certain companies to use your suggestion. As far for what 'mostly' means. I have been coding since the K&R days, so I am aware that even when things are supposed to be 100% the same among C compilers, reality speaks otherwise.