define
-
Contracts for C
C++ seems to finally converge with their contracts proposal, https://wg21.link/p2900. I decided to give it a try and come up with ideas how such a thing would look for C. This is in early stages, not a full proposal yet, and still would need implementation by some of the major compilers. In particular, the C++… Continue reading
-
Preprocessor meta-quotes with eĿlipsis
The new revision of eĿlipsis (20250219) has a lot of cleanups, bugfixes etc, but one thing I’d like to emphasize is a new feature that I’d call meta-quotes in lack for a better idea of a name that implement exemption of tokens from macro replacement. So in C that would interact with translation phase 4.… Continue reading
-
Simple defer, ready to use
With this post I will concentrate on the here and now: how to use C’s future lifesaving defer feature with existing tools and compilers. Continue reading
-
Tail recursion for macros in C
In view of the addition of __VA_OPT__ first to C++ and now to C23, there had been interest in extending the C preprocessor to include recursion. The basic idea would be that __VA_OPT__ can be used as a test within a macro such as in the following Indeed, the __VA_OPT__ clause only inserts its contents… Continue reading
-
#include __FILE__
Include recursion in C is possible and useful. Continue reading
-
Effective types and aliasing
I already have posted about the evilness of cast some time ago, but recently I have seen that there is still much confusion out there about the C rules that pointer casts, also called type punning, break. So I will try to give it a more systematic approach, here. In fact, I think we should… Continue reading
