[previous] 0884 [next] Using multiple # operators in the same macro definition.
Preprocessing REFERENCE - ISO:C90-6.8.3.2 The # Operator - Semantics

More than one # operator is present in this macro definition

The order in which # operators are evaluated during the expansion of a macro is unspecified. In most situations this will be irrelevant, but it may be wise to avoid using more than one # operator within the same macro.

For example:


/*PRQA S 336,1307,2017,3122,3200,3209,3429,3435,3408,3447,3602,3625 ++*/

#include <stdio.h>

#define M(X,Y) printf(#X "=%d, " #Y "=%d\n", X, Y)              /* Message 0884 */

extern int a1;
extern int a2;

extern void foo(void)
{
    M(a1, a2);
}


No MISRA C:2012 Rules applicable to message 0884


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