It is observed that functions like macros like NOTICE, WARN and assert are present in the Trusted Firmware-A code. MISRA-C standard treats these as violations. shall we take these as deviation? please suggest.
Here attached the MISRA violation, enter image description here enter image description here
TFA Guidelines recommends using logging macros. So can we make deviations or need to change the MACRO into function.
MISRA C:2012 checker violations against Directives is a bit fishy, since Directives are by their nature hard to analyze for a tool. Dir 4.9 is about not using function-like macros if a function can be used instead. The Directive is Advisory and in practice very hard to follow.
If the macro is present in a library you are using, then you don't really have the option to rewrite it as a function - these look like
printfwrappers (which might be another problem because stdio.h is banned from production code).If you think like function-like macros like these will be common, then maybe address Dir 4.9 in your MISRA C documentation and then block the rule in your tool. Otherwise if this is just a single case where you can't replace the macro with a function, maybe treat it as a code-specific deviation (even though the Directive is Advisory) according to your deviation procedure.