This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

C/C++ Compiler v22.6.1.LTS minor typo in stdint.h

Part Number: TMS320F280039

Tool/software:

Definitions for UINT16_MAX, both in stdint.h and in machine/_stdint.h are as in

#define UINT16_MAX 0xffff

while they should at least be

#define UINT16_MAX 0xffffU

This is happily compiled (and used) anyway by the compiler. However, it fails with MISRA (2012) rule 7.2, A “u” or “U” suffi x shall be applied to all integer constants that are
represented in an unsigned type, triggering a violation on code apparently legal, as

uint16_t  value = UINT16_MAX;

Note also that UINT32_MAX and UINT64_MAX are properly suffixed with "U"