Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rule 4-5-3 about using relational operators to determine uint8_t
#4
We agree with your interpretation, its non-compliant.

The exception in 4.5.3 only allows the use of plain char "to determine if a character (or wide character) represents a digit".

Rule 5-0-11: the plain char type shall only be used for the storage and use of character values
Rule 5-0-12: signed char and unsigned char type shall only be used for the storage and use of numeric values

If neither of these rules has been deviated, 'uc' should not represent a character and so the exception doesn't apply and the code is non-compliant
Posted by and on behalf of
the MISRA C++ Working Group
Reply


Messages In This Thread
RE: Rule 4-5-3 about using relational operators to determine uint8_t - by misra cpp - 14-11-2025, 01:14 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)