MISRA Discussion Forums

Full Version: How to fix Warnings 10.1 and 10.3
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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 */
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.