![]() |
![]() |
3453 | ![]() |
||||
![]() | |||||||
| Macro Definition | |||||||
This macro appears to be in the form of an expression and could therefore, perhaps, be replaced with a function. It is not always practical or convenient to replace function-like macros with functions; but functions are generally safer than macros because type-checking can be enforced on arguments. Message 3453 is generated for a function-like macro which ...
/*PRQA S 553,2017,3429 ++*/
#define M1(a, b, c) ((a) + (b) + (c)) /* Message 3453 */
#define M6(A,B) ((A)[1] + (B)[2]) /* Message 3453 */
MISRA C:2012 Rules applicable to message 3453:
| Dir-4.9 (Advisory) | A function should be used in preference to a function-like macro where they are interchangeable |
See also:
![]() | ||
| QA·C Source Code Analyser 8.1
MISRA C:2012 Compliance Module 1.0 © 2012 Programming Research. www.programmingresearch.com | Personality Groups | Glossary | Message Index | MISRA C:2012 Rule Index | Contents |