Rule 10.4 MISRA C 2012

PC-lint Plus User Discussion
Post Reply

Rule 10.4 MISRA C 2012

Post by Peter »


using the PC Lint Version 9.00k with the MISRA C 2012 standard creates an error 9029 (Mismatched essential type categories for binary operator [MISRA 2012 Rule 10.4, required]) which I don’t understand.
Using the MISRA C 2004 standard does not point that error at this line.
Just the example where the error 9029 occurs. I now the union rule, but old code has to be reused which contains unions....

Code: Select all

typedef union
  uint8_t b[2];
  uint16_t w;

typedef struct
  uint16_t value;
  TestUnion_tu TestUnion[5u];

void foo(void)
	TestStruct_ts testStruct;
	/* Here the error 9029 occurs */
	test.TestUnion[1u].w = 5u;
Any idea?
Thanks for any help.

Re: Rule 10.4 MISRA C 2012

Post by Maxwell »

Your example uses something called test in the last statement but nothing is defined with this name.

Re: Rule 10.4 MISRA C 2012

Post by mmetivier »

Also, this doesn't appear to be an issue using PC-Lint Plus, which likely makes it a shortcoming of original PC-Lint's type system that was resolved when much of the underlying code was redone in the new utility.
Post Reply