How to return an address of a const struct member in compliance to MISRA from a C function?
I have a C function that gets the address of a struct member and returns it as a void pointer.
The first parameter of the function provides a pointer to the struct. This parameter is provided as const
to prevent the struct members being modified by the function.
MISRA 2023 rule C.11.8 however, does not allow to cast a const
pointer to a pointer.