MISRA Discussion Forums

Full Version: Dir 4.6 and usage of "fast" types in stdint.h
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Directive 4.6 indicates "typedefs that indicate sign and signedness should be used in place of the basic numerical types" and suggests that, for C99-compliant systems, the types of should be used.

stdint.h also defines "fast" types which are at least of the indicated length, but may be larger if such a length could be handled more efficiently by the processor.

Is it a violation of Directive 4.6 to utilize these types? They are not "basic numerical types", but also do not necessarily adhere to a fixed length as specified by their names.
The use of types such as int_fast8_t and int_least8_t violates Directive 4.6.

The amplification to directive 4.6 states:
Quote: A type must not be defined with a specific length unless the implemented type is actually of that length.
The use of types such as int_fast8_t and int_least8_t does not guarantee that the type is actually of 8-bits.