[previous] MISRA-C:2004  Rule  19.13:  (Advisory) [next] The # and ## preprocessor operators should not be used.
There is an issue of unspecified order of evaluation associated with the # and ## preprocessor operators. Compilers have been inconsistent in the implementation of these operators. To avoid these problems do not use them.

Example Code:


#include "misra.h"

#include "gen.h"
#include "m2cmex.h"

#define STRINGIFY( S ) #S
#define GLUE( S1, S2 ) S1 ## S2

extern S16 test_1913( void )
{
   const PC rule[] = "rule 19.13";

   put_line( STRINGIFY( MISRA ) );
   put_line( GLUE( ru, le ) );

   return 0;
}


QAC messages that encompass this guideline:

0341 Using the stringify operator '#'.
0342 Using the glue operator '##'.



(c) The Motor Industry Research Association, 2004
QA C Source Code Analyser 8.1.2
MISRA-C:2004 Compliance Module 3.2
© 2013 Programming Research
www.programmingresearch.com
Personality Groups | Glossary | Message Index | MISRA-C:2004 Rule Index Contents