[previous] 0853 [next] [U] Macro arguments contain a sequence of tokens that has the form of a preprocessing directive.
Explicitly undefined REFERENCE - ISO:C90-6.8.3 Macro Replacement - Semantics

A function-like macro is being expanded and preprocessing directives have been encountered within the list of arguments. This is not permitted.

For example:


/*PRQA S 850,911,2017,2214,3110,3206,3227,3408,3417,3429,3453 ++*/

#define ADD(X, Y) ((X) + (Y))
#define SW

extern int foo ( int a, int b, int c )
{
    int r;

    r = ADD( a,                 /* Message 0907 - syntax error - and others XXXX */
#ifdef SW                       /* Message 0853 */
             b
#else                           /* Message 0853 */
             c
#endif                          /* Message 0853 */
             );

    return r;
}


MISRA C:2012 Rules applicable to message 0853:

Rule-1.3  (Required) There shall be no occurrence of undefined or critical unspecified behaviour
Rule-20.6  (Required) Tokens that look like a preprocessing directive shall not occur within a macro argument


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