14-11-2025, 01:14 PM
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
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
the MISRA C++ Working Group

