Code review deviations
In some cases, it can be useful to temporarily ignore a rule non-compliance on a short portion of source code, while documenting the reason why you are allowing this deviation.
About this task
Procedure
- Open the source file in the Text editor and find the lines of code that you want the rule to ignore.
-
Before the section of code for which compliance to the rule should be ignored, add one of the
following lines:
- To justify non-compliance of a rule to the following pragma statement in the first
occurrence:
#pragma attol crc_justify (<rule>[,<lines>],"<text>")
- To justify non-compliance of a rule to the following pragma statement in all
occurrences:
#pragma attol crc_justify_all (<rule>,<lines>,"<text>")
- To justify the first occurrence of non-compliance of a rule in all the files of the current
project, including in traps located before the pragma
statement:
#pragma attol crc_justify_everywhere (<rule>,"<text>")
For all the pragma statements: <rule><rule>
is the name of the code review rule (for example: 'Rule M8.5').<lines>
is the number of lines.<text>
is the reason why the rule is ignored.
The recommended usage for
crc_justify_everywhere
is to create a specific source file containing only the list of pragma statements and add this file to the project. - To justify non-compliance of a rule to the following pragma statement in the first
occurrence: