Keith Thompson wrote, On 25/04/08 17:23:
Sensei said:
Jacob, as a learner here I really do care about portable code, so I'd
be happy to know what is in the standard, what is specific to a
platform (or a set of), and finally what is implementation specific.
[...]
The latest (post-C99) draft of the standard is freely available at
<
http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf>.
Drafts of the more widely supported C90 standard are slightly harder
to come by (I'm sure someone will post a URL or two in response to
this).
Ask and it shall be done...
http://clc-wiki.net/wiki/c_standard
It also has links to where you can find the rationales which say why
some of the C standard is the way it is.
But since C99 is very nearly a superset of C90 (dropping
implicit int was probably the biggest exception),
I would always have considered using an explicit int to be better style
anyway. Others may disagree, of course.
if a feature isn't
mentioned in n1256.pdf you can be reasonably sure that it's not in any
C standard.
True.
The most portable version of the C language is the common subset of C99
and C90.
Also Sensei should note that you normally have to supply extra options
to get any compiler to fully conform to the C standard, and sometimes
further options to make it warn/error on extensions (some will never
warn/error on every extension they support), and more options to get the
compiler to get a load more useful warnings.
In short, read the documentation and find out how to make your compiler
conform to the standard and warn about as much as possible.