...
When part of the operand of the sizeof
operator is a VLA type and when changing the value of the VLA's size expression would not affect the result of the operator, it is unspecified whether or not the size expression is evaluated. See unspecified behavior 22 in Annex J, Section subclause J.1, of the C Standard [ISO/IEC 9899:2011].
...
This example compiles cleanly under Microsoft Visual Studio 2005, Version version 8.0, with the /W4 option.
...
If expressions that appear to produce side effects are supplied to the sizeof
operator, the returned result may be different than expected. Depending on how this result is used, this it can lead to unintended program behavior.
...
Tool | Version | Checker | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
|
|
| |||||||
| CC2.EXP06 | Fully implemented | |||||||
| 54 S | Fully implemented | |||||||
PRQA QA-C |
| 3307 | Fully implemented |
...