Code review deviations

In some cases, it can be useful to temporarily ignore a rule non-conformance on a short portion of source code.

You must provide a justification that explains why you are allowing the deviation. The justification text is included in the code review report.

You can declare a deviation in the source code, for a specified number of lines and for the first or all occurrences of the error, by adding the following pragma lines to your source code:
  • #pragma attol crc_justify (<rule>[,<lines>],"<text>"): ignores the first occurrence of a specified non conformance
  • #pragma attol crc_justify_all (<rule>,<lines>,"<text>"): ignores all occurrences of a specified non conformance in a portion of code following the pragma
  • #pragma attol crc_justify_everywhere (<rule>,"<text>"): ignores all occurrences of a specified non conformance in the entire project
Where:
  • <rule> is the name of the code review rule. For example: "Rule M8.5".
  • <lines> is the number of lines.
  • <text> is the justification of why the rule is ignored here.
The following example causes all non-conformances to the rule M8.5 in the 3 next lines to be ignored and explained in the code review report.
#pragma attol crc_justify_all (Rule M8.5, 3, "Rule M8.5 does not apply to the 3 following lines")
Feedback