Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
14.1 There shall be no unreachable code
#11
George Brown Wrote:Is there a MISRA Rule which bans uncalled global functions?
No, though there are is rule 8.2 enforcing an explicit linkage specifier (extern or static). The ISR definition should always be static, no other code module in the system could be interested of it. The ISR may however have a function prototype, hopefully, if the compiler allows that. If it doesn't, the ISR doesn't conform to rule 8.1 (must have a prototype), strictly speaking. With a good C compiler, you should only need a deviation from MISRA-C 1.1 (ISO C) when using interrupts.

Anyway, I would treat the calling of an ISR as an allowed exception to rule 14.1. All code within the ISR should naturally still be subject to the rule.


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)