💾 Archived View for separateconcerns.com › 2014-01-02-clang-forgotten.gmi captured on 2023-12-28 at 15:27:37. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2023-04-19)

-=-=-=-=-=-=-

C: what I had forgotten

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).

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;

1: http://blog.separateconcerns.com/2013-12-12-infinity-beyond.html