10 comments

[ 3.6 ms ] story [ 31.1 ms ] thread
been working on this for some time. has some usable features. i keep adding as i feel the need. try to well document everything and maintain it.
(comment deleted)
>Disclaimer: This library is not related to the MISRA C standard or guidelines. The name "MisraStdC" comes from the author's name, Siddharth Mishra, who is commonly known as "Misra" among friends.

Why include the letters Std then? This seems like a purposeful typo-squatting effort and definitely makes me suspicious.

Why do people do such wired projects? Why not just using C++ instead of pure C?
> A modern C11 library

I'd say "mostly C11": it uses __VA_OPT__ that's been standardized only in C23.

The "foreach" macros need a lot of refinement: passing the body in the parameters is asking for troubles, for example. And using a non-unique default name for the index prevents nested loops.

To overcome the issues with generic and qualified types, have you considered using typeof_unqual?

  _Generic(*(typeof_unqual(x)*)0, ...)
What disturbs me is the need to Init() everything. In the Vec type (the only one I've analyzed, actually) all it does is to fill everything with zeros and add a "magic" field certifying that the initialization happened. So why don't simply fill everything with zeros, which can be achieved with ={} if you're super modern or ={0} if you're not, and then drop the check for the magic field? Of course that wouldn't detect a missing intialization, but neither is it detected for any standard type.