Hi,

On 06/12/2023 02:42, Stefano Stabellini wrote:
On Tue, 5 Dec 2023, Luca Fancellu wrote:
Hi all,

I’m writing this mail to collect thoughts about the need to improve the SAF-* 
comments.

I think we reached a point where we need to use deviations for some violation 
that we want
to keep in the code with a proper justification and an issue was raised when 
the comment
cannot be put on a line on its own.

e.g.

If ( condition-1 &&
      condition-2 &&
       [...] )
{
     ...
}

For example in the code above, if the violation is in the second condition, 
breaking the conditions
to have an empty line between them for the SAF-* comment is not ideal, so we 
could maybe
improve the in-code comment to be used at the end of the line:

e.g.

If ( condition-1 &&
      condition-2 && /* SAF-*-safe [...] */
       [...] )
{
     ...
}

This might require also a deviation on the coding style to allow the comment to 
overcome the line length.

Bertrand, from his experience with safety certifications, feels that adding 
this feature could be enough
to cover the majority of the cases where we need to deviate a violation in the 
code.

Using it consistently in the code base as the only way to deviate a violation 
can also help the adoption
of the project to people who might want to fix them instead of deviating them, 
the only thing they would need
to do is to grep for SAF-* to have a rough idea of how many justified violation 
are in the code.

Please let me know your thoughts before I start to implement the feature.

I think we need this feature and in fact we have already been adding it
in an ad-hoc way with /* octal-ok */

It would like to remove octal-ok and use a generic way (SAF) to do the
same.

+1.

Cheers,

--
Julien Grall

Reply via email to