News for hackers. Stuff that matters.
Re:Auditable Macros in C Code by dummyfunnytoo on Friday November 24, 2017 @04:44PM (#15773189)
Which just raises the question for me, why have the macros at all? I did C++ development for years (on low level and performance sensitive applications) but 95% of the macros I saw were there to reduce lines of code or "eliminate boilerplate." Almost all of those could be eliminated by refactoring within C++, without resorting to the preprocessor, but developers love using macros...
Re:Auditable Macros in C Code by sjmulder on Saturday November 25, 2017 @01:43AM (#15774764)
The article is about C where not everything can be solved with a typedef, enum or templates. Think about feature macros (e.g. _C_POSIX_SOURCE), generics (pre-C11 or what was it), attributes or calling conventions, conditional compilation, function-like macros, compatibility (e.g. errno when it isn't just an extern int), and indeed shorthands.
Re:Auditable Macros in C Code by roywiggins on Friday November 24, 2017 @06:36PM (#15773615)
I guess it standardizes your boilerplate at write-time even if you have to review it expanded.