Inhibit PC-lint message 9007, MISRA



  • According to MISRA rule 13.5 the right hand operand of a logical && or || operator shall not contain persistent side effects. Our C-code is checked with PC-Lint, message 9007 (http://gimpel-online.com/MsgRef.html#9007).

    We have code of the form

    if((GET_SIGNAL1() < CONST_1) || (GET_SIGNAL2() == CONST_2) ) { dostuff(); }

    GET_x are macros, well, getting signal x with some error handling, the later causing intended side effects. A rule deviation to MISRA 13.5 is given, now the question is how to suppress the respective messages.

    Efforts so far: Since this is auto generated code I can't put in lint comments directly, putting the comments in through the generator is though and, primarily, hardly traceable.

    --e{(9007))} in the macro definition would work, but we also have code like foo = GET_SIGNAL1(); which would cause a function wide deactivation.

    Thought about -ecall, too, but it just checks the call itself, not the context of the macro (as I hoped).



  • Not sure if this will solve all the issues, but it should help some if you try to include SonarQube http://sonarqube.15.x6.nabble.com/ in your lint process/report. You should be able to customize the results a little more. I personally have not used this, but it seems to be where you are wanting to go.


Log in to reply
 

Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2