The basic numeric types
long double should not be used. Instead, specific-length typedefs should be. This rule helps to clarify the size of the storage, but does
not guarantee portability because of the asymmetric behavior of integral promotion.
Note that it is still important to understand the integer size of the implementation, and developers should be aware of the actual implementation
of the typedefs under these definitions.
Noncompliant Code Example
int function(unsigned short a) // Noncompliant
int32_t function(uint16_t a) // Compliant
- MISRA C:2004, 6.3 - typedefs that indicate size and signedness should be used in place of the basic types
- MISRA C++:2008, 3-9-2 - typedefs that indicate size and signedness should be used in place of the basic numerical types
- MISRA C++ 2008 Section 6.5.0 on integral promotion