C99
Findings about C, with an emphasis of programming withs standards, in particular C99
-
Alias and references as localized macros
Since the last meeting of the C committee I am struggling with the idea of aliases as they are proposed in a long series of papers by JeanHeyd. Transparent Aliases I am struggling with this for several reasons, but most importantly is that I have the impression that it is a heavy gun pointed on… Continue reading
-
A diagram of C23 basic types
This week on the C committee mailing list we had a discussion about how C’s types are organized into different categories. At the end I came up with a diagram with that organization. It basically translates the section “6.2.5 Types” of the C23 standard into a graph of inclusions. Sorry, it is probably a little… Continue reading
-
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
-
The C23 edition of Modern C
The C23 edition of Modern C is now available for free download from https://hal.inria.fr/hal-02383654 And as before a dedicated page for the book may be found at https://gustedt.gitlabpages.inria.fr/modern-c/ where you also may find a link to download the code examples that come with the book. Continue reading
-
Braiding the spaghetti: implementing defer in the preprocessor
I already talked about a proposal for an extension of the C language calleddefer, that is prospected to either be published in a technicalspecification or the next revision, C2Y, of the C standard: EĿlipsis now implements a simple form of this feature by mixing some specific preprocessor extensions (in particular counters) with the usual macro… 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
-
EĿlipsis: a language independent preprocessor is released
EĿlipsis is an extension and continuation of the C preprocessor with theaim to be useful for other technical languages, be they programminglanguages or text processing languages. There were several goals when developing eĿlipsis: https://gitlab.inria.fr/gustedt/ellipsis the sources at INRIA’s gitlab server https://gustedt.gitlabpages.inria.fr/ellipsis documentation on the gitlab pages https://gitlab.inria.fr/gustedt/ellipsis/-/boards issue trackers on different boards Bugs if things… Continue reading
-
#include __FILE__
Include recursion in C is possible and useful. Continue reading
-
White space does matter in C23
Usually in C identifiers are not directly followed by strings. But when U prefixed literals were introduced in C. there still were some rare clashes with existing code. This happened were a macro U that expanded to a string was used to add some sort of leading character sequence to a string. Prior, this usage… Continue reading
-
The deprecated attribute in C23 does much more than marking obsolescence
You may already have heard that C23 proposes a new syntax feature called attributes and that one of the standard attributes in C23 is called deprecated. Actually, we got this whole attribute thing and also some of the standard attributes from C++, where they had been introduced in C++11 (I think). One of the uses of… Continue reading
