C++ seems to finally converge with their contracts proposal, 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, a…| Jens Gustedt's Blog
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 "Braiding the spaghetti: implementing defer in the preprocessor"| Jens Gustedt's Blog
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 …| Jens Gustedt's Blog
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…| Jens Gustedt's Blog
I received a few complaints that #embed was difficult to implement and hard to optimize. And, the people making these claims| The Pasture
Use of preprocessor macros is full of pitfalls.In fact, its user manual includes a section called “Macro Pitfalls”.One of these pitfalls revolves around operator precedence.Operator precedence problems happen when the expectations about pass-by-value, the default for C functions, are applied to function-like macros.Function-like macros are pass-by-name; the arguments are textually substituted in the macro body.This is especially confusing because both C and preprocessor functions have the...| Open the Black Box
My graduate work on SuperC made made me way too familiar with the C preprocessor’s ins and outs, more than I ever could have imagined (or wanted).SuperC’s novel preprocessing and parsing algorithms let you parse a program without having to run the preprocessor first.Solving this challenge exposed me to interesting quirks of the preprocessor and strange usage patterns that appear in the wild.I’d like to share these and bring attention to this underrated aspect of compilers, hopefully pro...| Open the Black Box