>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.
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?
I especially am in love with how my formatted printer works. It's not a completely new solution and I think people have already done that. I'll also say that it's not very mature but it makes life a lot easier in some cases.
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.
10 comments
[ 3.6 ms ] story [ 31.1 ms ] threadThere can be only one.
Why include the letters Std then? This seems like a purposeful typo-squatting effort and definitely makes me suspicious.
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?
One example is me parsing HTTP headers: https://github.com/brightprogrammer/beam/blob/master/Source%...