Re: MISRA


Hibberd, Amber M
 

All,

 

  1. As a reminder, the TSC agreed upon the Zephyr Project Coding Guidelines. We are working towards compliance to the Project CG. Yes, they are a subset of Misra, but we are not going for Misra compliance.
  2. The Safety Committee, in driving toward the Project goal of certification-ready, has partnered with Bugseng, as part of the community, to help build momentum towards this goal.
  3. There is a process for removing, revising, having exceptions, etc to the CG rules. If you think a rule should be changed, open an issue in Github.

 

The Safety Committee is bringing an update to the TSC tomorrow, where we can have a discussion around the CG compliance work.

 

-Amber

 

From: devel@... <devel@...> On Behalf Of Benjamin Lindqvist
Sent: Monday, December 13, 2021 2:44 PM
To: Abramo Bagnara <abramo.bagnara@...>
Cc: Pitre, Nicolas <npitre@...>; Zephyr Devel <devel@...>; Kevin Hilman <khilman@...>
Subject: Re: [Zephyr-devel] MISRA

 

Well if code quality is truly the only goal of the steering committee and there's no politics involved then I retract everything I said. Misra offers less than nothing for this project. But I don't believe that's true. This is 100% politics if you ask me.

 

Also before declaring the virtues of Misra, you'll be sure to clarify any vested financial interest you might have in the matter, right? You know, just to make sure you're not shilling. 

 

On Mon, Dec 13, 2021, 9:38 PM Abramo Bagnara <abramo.bagnara@...> wrote:

Il 13/12/21 04:37, Nicolas Pitre ha scritto:
> I've also seen too many times a bug being introduced because the code
> was modified just to make it [name your favorite static analysis tool /
> coding standard here]-compliant. It is often the case that the code is
> questionnably written in the first place, and adding typecasts to it
> makes it worse even if the scanning tool is then happy.

I'd like make clear once and for all that the happiness of scanning tool
is *never* a valuable purpose under a MISRA perspective.

What matter is *only* the quality of code and MISRA is a tool to achieve
this purpose.

Il 13/12/21 04:37, Benjamin Lindqvist ha scritto:

> Hopefully most people in the community agree that many, if not most,
 > Misra rules are outdated or even slightly harmful. But you optimize
 > with the constraint being the way the world works, not how it should
 > ideally work. If this is what it takes to get zephyr backed by Daimler
 > and Volvo, I for one can't blame the steering committee for thinking
 > the tradeoff is justified. I'd do the same thing probably, despite
 > loathing Misra with all my heart.

In my experience this is a consequence of a misunderstanding of what
MISRA really is.

MISRA process has rules, but also deviations and permits and the only
sane way to use it is as a tool to improve
safety/readability/understanding/analyzability.

Please forget every other idea of it as an enemy to beat or to surrender to.

As Nicolas has already done you are welcome to point out *any* proposed
change related to MISRA compliance that you think will make code worse
together with an alternative proposal to improve code at the same time.

I hope this will clarify that everyone in the community has the same
code improvement goal and, as usual, constructive collaboration is the key.

--
Abramo Bagnara

BUGSENG srl - http://bugseng.com
mailto:abramo.bagnara@...

Join {devel@lists.zephyrproject.org to automatically receive all group messages.