News for hackers. Stuff that matters.
Re:A comprehensive guide to 50 years of evolution of strict ... by pjmlp on Friday November 26, 2021 @09:01AM (#29350231)
True, but still one way I appreciate making C safer is by using poor man's Abstract Data Types with translation units.

For the use cases that are too expensive to use functions, macros can be used instead.

However that is only if C++ cannot be used at all, otherwise don't bother.

Re:A comprehensive guide to 50 years of evolution of strict ... by jacquesm on Friday November 26, 2021 @11:03AM (#29351350)
That works, at the expense of possibly hiding bugs in plain sight. Macros are a double edged sword in that sense, you can almost but not quite create a DSL on top of C that is a lot more safe but it has its drawbacks, and you need to be very good at mentally modeling macro expansion to read and debug code like that in order to ensure that it does what it seems to be saying that it will do.
Re:A comprehensive guide to 50 years of evolution of strict ... by pjmlp on Friday November 26, 2021 @11:33AM (#29351646)
Agree, if it is me, I rather use inline functions, but anyway as mentioned only use C when there is no other option.