Losing the magic
Losing the magic
Posted Dec 5, 2022 20:58 UTC (Mon) by iabervon (subscriber, #722)Parent article: Losing the magic
I think the innovation is really the macros that enforce type safety before discarding the type information. There are still plenty of structures that store a function with an argument and a pointer that has to match, where the structure can't validate them (and different instances of the structures don't match each other), but the macros for creating the structures ensure that, still having the type information, you could call the function with the argument without getting a type error. I don't think it was common knowledge until that time frame that it was possible to tell a C compiler "generate any warnings or errors for this expression, but don't generate code to evaluate it". (Or maybe it's still not common knowledge, but the kernel has all the macros needed to do it, and they're commonly used.)
The LWN site is currently under high scraper load, so comment display has been suppressed for anonymous users. If you are a human, you may read the comments by clicking the button below:
Note: you can avoid this step in the future by logging into your LWN account.
