Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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

Compass/ROSE

 

 

 

ECLAIR

Include Page
ECLAIR_V
ECLAIR_V

CC2.EXP06

Fully implemented

    

LDRA tool suite

Include Page
LDRA_V
LDRA_V

54 S

Fully implemented

PRQA QA-C
Include Page
PRQA_V
PRQA_V
3307Fully implemented

...