[previous] 0835 [next] [C] Macro '%s' is being redefined with different parameter names.
Constraint violations REFERENCE - ISO:C90-6.8.3 Macro Replacement - Constraints

This is a constraint error

A #define directive has attempted to redefine a function-like macro with a definition which is identical in all respects except for the names of the parameters. A #define directive cannot redefine an existing function-like macro unless the definitions are identical (apart from white space differences). It is seldom wise to change the definition of an existing macro, but if it is really necessary, the #undef directive must be used first.

For example:


/*PRQA S 553,841,2017,3429,3435,3453,3456,3614 ++*/

#define M1(a,b) ((a) + (b))
#define M2(a,b) ((a) + (b))
#define M3(a,b) ((a) + (b))

#define M1(x,y) ((x) + (y))         /* Message 0835 - different parameter names */

#define M2(a,b) ((a) + 2 * (b))     /* Message 0844 - different replacement list */

#undef M3
#define M3(x,y) ((x) + 2 * (y))     /* OK           */


MISRA-C:2004 Rules applicable to message 0835:

Rule  1.1  (Required) All code shall conform to ISO/IEC 9899:1990 C programming language, ISO 9899, amended and corrected by ISO/IEC 9899/COR1:1995, ISO/IEC 9899/AMD1:1995, and ISO/IEC 9899/COR2: 1996192


See also:

QA·C Source Code Analyser 8.1
MISRA-C:2004 Compliance Module 3.2
© 2012 Programming Research.
www.programmingresearch.com
Personality Groups | Glossary | Message Index | MISRA-C:2004 Rule Index Contents