Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rule 11.9: Does this struct initialization violate rule 11.9?
#1
Dear community,

our analysis tool reports the following struct initialization to violate rule 11.9 (macro NULL is the only permitted form of integer null pointer constant):

static const myType myStruct = {
64,
{0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0,0xa0},
0
};

with:
typedef unsigned short uint16;
typedef unsigned char uint8;
typedef struct {
uint16 myVariable01;
uint8 myArray [16];
uint8 myVariable02;
} myType;

Unfortunately, neither from the tool documentation nor from the MISRA documentation we can conclude why this initialization would be non-compliant. Also we cannot see what the risk behind this deviation would be. Is this deviation false-positive? Does it introduce any portability, maintainability etc. risk?

Thanks for your support.
Frank
<t></t>


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)