Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do new C books not adhere to the C99 standard?

Tags:

c

c99

Nearly every (relatively) new book about c programming I've seen doesn't seem to adhere to the C99 standard, or they cover it in an extra chapter. Comming from a Java background, the C99 standard made the migration (well, still migrating ^^) much easier for me, and this probably applies to other languages, too.

It seems like C99 hasn't reached most of the C developers yet. But why?

like image 349
helpermethod Avatar asked Feb 20 '10 20:02

helpermethod


People also ask

What is the difference between C99 and C11?

C11 looked to address the issues of C99 and to more closely match the C++ standard, C++11. It changes some C99 features required to optional. Some of the features include variable length arrays and complex numbers. This makes it easier for compiler vendors to meet C11's required function set.

What is the difference between C90 and C99?

C99 has newer C99 features plus Microchips attempt to make all the compiler work more similarly. C90 is the older standard and older front end. Older code may not work with the C99 option. You would have to make changes to support the differences.

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.

What is standard C compiler?

ANSI C is now supported by almost all the widely used compilers. GCC and Clang are two major C compilers popular today, both are based on the C11 with updates including changes from later specifications such as C17 and C18.


2 Answers

Short answer: compiler support is slow to get installed and c programmers are a conservative lot who change their behavior slowly.

like image 127
dmckee --- ex-moderator kitten Avatar answered Oct 26 '22 13:10

dmckee --- ex-moderator kitten


I strongly suspect it's mainly because MSVC does not attempt to support C99, and quite likely never will. There are a few embedded compilers in the same boat, but they're hardly common enough to matter much individually. AFAIK everyone else is at least trying to implement C99 as much as possible.

There isn't much reason in practice not to use selected features of C99, but if you're going to learn and write to one C standard, and only one, then it must be C89.

Furthermore, it's probably quite difficult and confusing to write an introductory C text which starts out by saying "OK, there are two different standards, and I'm going to use three different colours of text: one for C89, one for C99, and one for both". It's also probably harder to write about C99 for a whole book, and then "take back" a lot of what you've said in an appendix about C89, than it is to write about C89 and then add to it in an appendix about C99.

All speculation, though. Really you'd have to ask the authors of the books you're reading (or perhaps in some cases go against all your programming instincts, and read the foreword ;-))

like image 35
Steve Jessop Avatar answered Oct 26 '22 13:10

Steve Jessop