4 ms·
There is indeed a world outside of Linux and mobile, and most of that world doesn't have a problem working with C99 and C11. Windows is - as with many other th
by udp 14y ago
There is indeed a world outside of Linux and mobile, and most of that world doesn't have a problem working with C99 and C11. Windows is - as with many other things - the exception, and it's getting tiresome.
There's no way Windows developers are going to stop using Visual Studio - and rightly so, because it's a very good IDE. So there are basically three things Microsoft could do to resolve this situation and let Windows developers make use of modern C code:
1. Update their C89 compiler to a newer C standard. This is unlikely, and probably a lot of work for Microsoft (I'm guessing they'll be removing the C compiler from one of the next releases of Visual Studio).
2. Add support for essential C99/C11 features to their C++ compiler, such as designated initializers. This would still force us to compile our C as C++ and do nasty things like casting the return type of malloc, but it might be the easiest solution.
3. Switch to a modern, open source C compiler like Clang. I would be very surprised if Microsoft would do anything like this (else IE would be using WebKit already).
So we're basically forced to either butcher our C code to make it compile as C++, or write C89. Or drop MSVC support, making our projects difficult for Windows developers to work with.
- norswap 14y agoOr choose the path of least resistance and use C++. Even if it is C-like C++. Not that I wouldn't like to have MS to support C99 and C11 though.
- jlarocco 14y agoThat may work for developers writing their own projects on Windows, but presents a problem when using other people's code. Not many developers on Linux and OSX are going to hold out on using new features just to coddle Windows users.
- norswap 14y agoSo Linux does not have C++ those day? (Just kidding.) But C++ definitely matches C feature for feature, even tough the way or doing things are not always the same.
- pjmlp 14y agoAnd what about QNX, Aix, HP-UX, Solaris, VxWorks and many others? Not everyone is allowed to use modern versions of clang and gcc.
- vonmoltke 14y agoThat was exactly the case at my last job. We used only a small subset of C99, primarily stdint.h. From a technical perspective, though, the latest standards are easily usable on AIX. IBM has done a good job of keeping XLC up-to-date, and it has supported C11 since May.[1] [1] http://www.ibm.com/developerworks/rational/library/support-iso-c11/index.html http://www.ibm.com/developerworks/rational/library/support-i...
- pjmlp 14y agoI think the most problematic is HP-UX and all the non UNIX based systems, specially the ones where the vendor's compiler is the one to use.
- corresation 14y agoThere's no way Windows developers are going to stop using Visual Studio - and rightly so, because it's a very good IDE. So there are basically three things Microsoft could do to resolve this situation and let Windows developers make use of modern C code Another option is the Intel C(++) compiler, integrated directly into Visual Studio.