published 2014-01-02
Thanks to my new job [1] I will have the opportunity to write a lot more C than in the last three years. To prepare for this, I decided to read some old C89 books again and see what I remembered. Here are some of the quirks I had forgotten (or never known about).
int
, i.e. f(void) {};
is valid and equivalent to int f(void) {};
.
const struct stuff_s { /* stuff */ } stuff_t;
means the same thing as:
struct stuff_s { /* stuff */ } const stuff_t;
but if you wrote it you probably meant this instead:
struct stuff_s { /* stuff */ }; typedef const struct stuff_s stuff_t;
a[i] = i++;
. There is no sequence point so the result is undefined.
NULL
to be different from 0
, but its value has to be 0
so you can almost always write code that assumes NULL == 0
and be right provided you do not actually test NULL == 0
.
=> 1: https://blog.separateconcerns.com/2013-12-12-infinity-beyond.html This content has been proxied by September (3851b).Proxy Information
text/gemini;lang=en_US