Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to fix Warnings 10.1 and 10.3
#1
Hi. We're new to MISRA-2004. Can anyone explain why I get these warnings and how to fix them. We are using Code Composer.

unsigned int x = 0U;
unsigned int* px;

px = &x; /* 10.1 warning */
px = (unsigned int*)&x; /* 10.3 warning */
<t></t>
Reply
#2
Both lines are compliant with all MISRA-C:2004 rules, except Rule 6.3 which requires typedefs instead of "unsigned int".

Rules 10.1 and 10.3 only apply to integers types whereas these operations are on pointers.
Posted by and on behalf of the MISRA C Working Group
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)