[previous] MISRA C:2012  Rule-3.1:  (Required) [next] The character sequences /* and // shall not be used within a comment.

Exception:

The sequence // is permitted within a // comment.

Example Code:


#pragma PRQA_MESSAGES_OFF 3108

#pragma PRQA_MESSAGES_ON 3108

#include "misra.h"
#include "m3cmex.h"

extern int16_t rule_0301( void )
{
   int16_t ax = 0;                 /* 3108 5133      */   /*      */     /* /*  nested comment ? */

   int16_t bx = 0;                 /*      5133      */   /*      */     /* //  nested comment ? */

   int16_t cx = 0;                 /*      5133 1011 */   /*      */     // /*  nested comment ? */

   int16_t dx = 0;                 /*           1011 */   /*      */     // //  C++ nested comment allowed within C++ comment.

   return 0;
}


QAC messages that encompass this guideline:

3108 Nested comments are not recognized in the ISO standard.
5133 Comment delimiter /* or // found within comment.



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