Microsoft, please support (at least a tiny bit of) C99
I’m afraid this plea will be mostly futile, but I just have to get it out. Microsoft, please support (at least a tiny bit of) C99.
Though it may seem strange, there are still a lot of us writing in C (and not C++), particularly in the open-source world. For example, all of the following very important open-source projects (which all are portable to Windows) are written either partially or entirely in plain C:
- almost every open-source language VM (eg. Python, Lua, LuaJIT, Ruby, Perl, PHP, Erlang, R, Guile)
- numerous very powerful software libraries (eg. zlib, sqlite, libmad, ffmpeg/libavcodec, x264, libsndfile, libsamplerate, gmp, fftw, libxml2, FreeType, libjpeg, libpng; this list is just the tip of the iceberg, there are way too many to list).
- numerous apps/tools/servers (eg. Apache, nginx, vim, emacs, MySQL, PostgreSQL)
The reason you offer for not adding C99 support is
Hi: unfortunately the overwhelming feadback we get from the majority of our users is that they would prefer that we focus on C++-0x instead of on C-99. We have "cherry-picked" certain popular C-99 features (variadic macros, long long) but beyond this we are unlikely to do much more in the C-99 space (at least in the short-term).
It may be that we C users are in the vast minority. But considering that we have been offering free, high-quality software that enhances the usefulness of the Windows platform for both users and developers, couldn’t you help make our job just a little easier by implementing even these most basic C99 features?
- stdint.h and inttypes.h. Someone else has already done the work for you and released it under a permissive license (stdint.h and inttypes.h). Can't you just download these files and use them?
- declaring variables in the middle of a block. Your C++ compiler can already do this, surely it wouldn't be too much work to update the C parser to support this?
- 'for' loop initial declarations. This is also supported in C++ already.
If I was feeling really lucky I might even ask for designated initializers, but I don’t want to push my luck.
Every other popular C compiler supports these features, which means that for many projects MSVC’s lack of C99 support is the single gating factor keeping us from taking advantage of features that were standardized almost 15 years ago. Think about this: a large and diverse project like Python which might have tens of committers and run on lots of platforms is tethered to an almost 25-year-old language standard (C89) because one single compiler that is written by one of the world’s largest software companies (with over 90,000 employees) can’t find the time to do what every other compiler vendor has already done.
As I was researching this article I discovered that the /TP option will make MSVC compile C as if it were C++, which may give me enough of a workaround (albeit hacky) to get the above features that I most sorely miss. I still wish Microsoft would give us cross-platform developers even the slightest tip of the hat to help us out with bringing free, high-quality software to their platform.