In some cases, it can be useful to temporarily ignore a rule non-conformance on a short portion of source code, while providing a justification of why you are allowing the non-conformance.
You can justify a non-conformance 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: ignores the first occurrence of a specified non conformance
#pragma attol crc_justify_all: ignores all occurrences of a specified non conformance
You must provide an explanation of why you are ignoring the rule. The justification text is included in the code review report.
To justify a rule discrepancy on a portion of code:
Open the source file in the text editor and locate the lines of code that you want the rule to ignore.
Before the portion of code, add the following line:
#pragma attol crc_justify (<rule>[,<lines>],"<text>")
to justify the first non-conformance encountered, or
#pragma attol crc_justify_all (<rule>,<lines>,"<text>")
to justify all non conformances, where:
<rule> is the name of the code review rule (for example: "Rule M8.5").
<lines> is the number of lines. By default the pragma only applies to the next line.
<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")
Related Topics