Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Parasoft C/C++test 10.4

...

Failing to use the correct syntax when declaring a flexible array member can result in undefined behavior, although the incorrect syntax will work on most implementations.

Rule

Severity

Likelihood

Remediation Cost

Priority

Level

DCL38-C

Low

Unlikely

Low

P3

L3

Automated Detection

Tool

Version

Checker

Description

Astrée
Include Page
Astrée_V
Astrée_V
 

Supported, but no explicit checker
Compass/ROSE

 

 



Can detect some violations of this rule. In particular, it warns if the last element of a struct is an array with a small index (0 or 1)

LDRA tool suite
 
Include Page
LDRA_V
LDRA_V
648 SFully implemented
Parasoft C/C++test

Include Page
Parasoft_V
Parasoft_V

CERT_C-DCL38-a

The final member of a structure should not be an array of size '0' or '1'
PRQA QA-C
Include Page
PRQA QA-C_v
PRQA QA-C_v
1037 1039
 

Related Vulnerabilities

Search for vulnerabilities resulting from the violation of this rule on the CERT website.

...

This rule supplements MEM33-C. Allocate and copy structures containing a flexible array member dynamically

Bibliography

[ISO/IEC 9899:2011]6.5.6, "Additive Operators"
6.7.2.1, "Structure and Union Specifiers"
[McCluskey 2001]"Flexible Array Members and Designators in C9X"

 


...