Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Dir 4.6 and usage of "fast" types in stdint.h
#1
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.
<t></t>
Reply
#2
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.
Posted by and on behalf of the MISRA C Working Group
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)