![]() |
![]() |
2201 | ![]() |
||||
![]() | |||||||
| Bracing and Indentation | |||||||
The indentation of this line is inconsistent with the indentation that has been used previously. QAC can be configured to enforce a specific level of indentation (for example 2,3,4 spaces etc.) using the -indentlevel option. If this option is not used, or specifies an indentation of 0 spaces, QAC does not enforce a specific number of spaces but will instead identify indentation that is simply "inconsistent". The level of indentation is established by examining the initial lines of the file. Subsequent inconsistencies are then identified with message 2201. For example:
/*PRQA S 2017,3120,3199,3408 ++*/
extern void f1(int x)
{
if (x > 0) /* Four spaces used for indentation ... */
{
x++; /* Message 2201 */
x++; /* Message 2201 */
x++; /* Message 2201 */
x++; /* */
x++; /* Message 2201 */
x++; /* Message 2201 */
}
if (x > 10) /* Message 2201 */
{
x++; /* Message 2201 */
x++; /* Message 2201 */
x++; /* Message 2201 */
x++; /* */
x++; /* Message 2201 */
x++; /* Message 2201 */
}
}
No MISRA C:2012 Rules applicable to message 2201
See also:
![]() | ||
| QA·C Source Code Analyser 8.1
MISRA C:2012 Compliance Module 1.0 © 2012 Programming Research. www.programmingresearch.com | Personality Groups | Glossary | Message Index | MISRA C:2012 Rule Index | Contents |