Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rule 8.10, I don't understand the Rationale
#6
Rule 8.10 was designed to cover the unspecified and undefined behaviour concerning inline functions.

The use of static inline functions does not exhibit unspecified or undefined behaviour (see note) and is therefore permitted by the MISRA-C guidelines. The declaration and use of static objects within a static inline function also does not exhibit unspecified or undefined behaviours. However, the MISRA-C working group agrees that such use of static objects might give rise to behaviours that is not expected by the coder. This issue will be considered in a future release of MISRA-C.

Note: The working group agrees with the post by Steve Montgomery which explains that the undefined behaviour in section 6.7.4.5 applies only to inline functions with external linkage, and therefore not to static inline functions.
Posted by and on behalf of the MISRA C Working Group


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)