13-09-2024, 02:58 PM
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.
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
the MISRA C++ Working Group