>
>
>
V3533. AUTOSAR. Expression containing i…


V3533. AUTOSAR. Expression containing increment (++) or decrement (--) should not have other side effects.

This diagnostic rule is based on the software development guidelines developed by AUTOSAR (AUTomotive Open System ARchitecture).

Using a decrement (--) or increment (++) operation along with other operators in one expression is not recommended. Using them in an expression that has other side effects makes the code less readable and may result in undefined behavior. A safer practice is to isolate the decrement/increment operators in separate expressions.

Example of non-compliant code:

i = ++i + i--;

This code attempts to modify one variable at one sequence point, which results in undefined behavior.

This diagnostic is classified as:

  • AUTOSAR-M5.2.10