News for hackers. Stuff that matters.
Re:Lisp macros for C by mikeash on Thursday April 20, 2017 @09:36AM (#14156464)
I'm not sure about C++, but C tries pretty hard not to break code that complies with a previous standard unless it's absolutely necessary, and they put some effort into avoiding breaking common extensions too.

This is why, for example, the language-level boolean type introduced in C99 is `_Bool`, and then you can include a standard header that will typedef it to `bool`. Identifiers that begin with an underscore and an uppercase letter are reserved for the implementation, so no compliant code will be using _Bool anywhere for itself. And since old code won't include `stdbool.h`, there's no conflict if it happens to define its own `bool`.

Given this, it seems like the best approach would be to call it `_Typeof` or similar, with a standard header that does `#define typeof(x) _Typeof(x)` to make it nicer to use.

There are no comments on this comment yet.