Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
9.4.2 - Why C-style enums are exempted from requiring a default clause?
#4
Short answer, yes.  Ideally, all your code should be MISRA compliant, so the values you get from the external library should already obey the rules for enum types. 

If you are using libraries that are not MISRA compliant, then you should be treating any values they return with suspicion, and use defensive coding to ensure the values have the expected properties - like enums not having undeclared values.
Posted by and on behalf of
the MISRA C++ Working Group
Reply


Messages In This Thread
RE: 9.4.2 - Why C-style enums are exempted from requiring a default clause? - by misra cpp - 13-09-2024, 02:58 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)