Versions Compared

Key

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

...

Code Block
bgColor#FFcccc
langc
#include <stdio.h>
 
void func(void) {
  static volatile int **ipp;
  static int *ip;
  static volatile int i = 0;

  printf("i = %d.\n", i);

  ipp = &ip; /* Produces warnings in modern compilers */
  ipp = (int**) &ip; /* Constraint violation,; also produces warnings */
  *ipp = &i; /* Valid */
  if (*ip != 0) { /* Valid */
    /* ... */
  }

}

...

Rule

Severity

Likelihood

Remediation Cost

Priority

Level

EXP32-C

lowLow

likelyLikely

mediumMedium

P6

L2

Automated Detection

Tool

Version

Checker

Description

Compass/ROSE

 

 

 

GCC

Include Page
GCC_V
GCC_V

 

Can detect violations of this rule when the -Wcast-qual flag is used

LDRA tool suite

Include Page
LDRA_V
LDRA_V

344 S

Fully implemented

PRQA QA-C
Include Page
PRQA_V
PRQA_V
0312Fully implemented

...