Misra rule 19.7 : function like macro
I have a warning regarding Misra rule 19.7 : A function should be used in preference to a function-like macro in the below line : #define gOFFSETOF(type, mem) (gOFFSET)((size_t) ((char *)&((type *) 0)->mem - (char *)((type *) 0))) how should I solve this ? Rule 19.7 (advisory): A function should be used in preference to a function-like macro. While macros can provide a speed advantage over functions, functions provide a safer and more robust mechanism. This is particularly true with respect to the type checking of parameters, and the problem of function-like macros potentially evaluating