Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Some seem to say that one should avoid C99 features in C code as compilers don't really support those features. C99 is a standard from 1999, shouldn't these features be quite widespread now?

Should one avoid using C99 features in new code? In legacy code? I happen to use some C99 features quite often, should I stop doing that or be more careful with the use of those features?

share|improve this question
When did "some" say that? – Crazy Eddie Feb 22 '11 at 19:28
@Crazy Eddie: Books on C, different articles on the web – Anto Feb 22 '11 at 19:29
I guess a better wording for this question would be: "How widely implemented is C99?" – chrisaycock Feb 22 '11 at 19:43
@chrisaycock: I want to know wether or not to use C99 features; the wideness of implementation is just something that my question happen to depend on – Anto Feb 22 '11 at 19:45
up vote 4 down vote accepted

Depends on how portable your code needs to be. C compilers support C99 features to a very different degree, and that can be a problem. See here for details:

Personally, I would stick with C89/C90 unless I was certain I would always compile the code with the same compiler.

share|improve this answer

Not at all. I would highly recommend using C99 code as, with anything really, it's standardized. The compatibility between compilers is always going to vary and frustrate but it's important to embrace standardization and simply embrace what developers SHOULD, theoretically, be using. I use C99 day-in-day-out and, apart from some hoo-ha with variadic macros, everything works well, especially on VS and Xcode (obviously).

share|improve this answer
C99 works especially well on VS? Maybe if you plug-in Intel's compiler. – Nemanja Trifunovic Feb 22 '11 at 21:17
Of course... Although various systems come with this as standard. – dbramhall Feb 22 '11 at 21:56

Despite C99's age, support remains spotty in several compilers (such as Microsoft Visual C++). Some C99 features, such as variadic macros, are supported by many compilers; other features, not so much. So you'll need to evaluate your cross-platform needs and decide if the compilers you'll need to use will support the features you want.

A second consideration is that C99 diverges more from C++. If you don't plan on ever incorporating C++, this is not an issue.

share|improve this answer
Well, from the various comments by MS and MS developers, you can learn VS C++ isn't really meant as a C compiler (as the name implies) - it's a C++ compiler that supports some C for legacy code. If you develop new code in C, VS C++ is simply not the right compiler to use (however, you can use the IDE and plug in a different compiler, with some limitations). – sleske Aug 25 '14 at 12:01

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.