Misra c and RTAI

Alessandro Rubini rubini at gnu.org
Thu Aug 1 16:33:34 CEST 2002

Thanks for your pointers.

Actually, The example shown (2.5 rules) looks like they are over-strict.

I read: "the programmer doesn't know operator priority"
and "the programmer doesn't know what an assignment it".

I very much prefer the compiler spitting warnings. I like gcc warning
about assignments used as conditionals, and adding an extra pair of parentesis
is the right fix.  Actually, I see no points in saying "don't use assignment
in conditionals" when most of those cases are programmer errors.

Still, it looks not as bad as it could be.  However, you can be sure
we are not compliant.

BTW: it would be very good to run the checker over RTAI sources. I refer
to that hacked copy of gcc that makes a lot of extra checks about use
of functions and so on, according to a set of rules to be checked
(like "any lock acquired must be released in the same function, in every
path of execution"). Anyone is willing to ask such a run?


More information about the Rtai mailing list