Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Clarification on rule 10.6
#2
This rule only applies to integer constants for which the standard C type without a suffix is an unsigned type. For example 0x8000 is of type unsigned int in a 16-bit environment. Rule 10.6 requires you to add a "U" suffix in this case.

The rule does not require you to add other suffices, for example the "L" suffix to those constants which have a long C type.

More details on the background to this rule can be read in the MISRA C:2012 documentation for rule 7.2.
Posted by and on behalf of the MISRA C Working Group
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)