C and C++


LANG.COMM.NEST.CSTYLE : /* in Comment

Summary

The string /* occurs within the body of a comment.

Properties

Class Name /* in Comment
Significance style
Mnemonic LANG.COMM.NEST.CSTYLE
Categories
MisraC2023 MisraC2023:3.1 The character sequences /* and // shall not be used within a comment
Misra2012 Misra2012:3.1 The character sequences /* and // shall not be used within a comment
Misra2004 Misra2004:2.3 The character sequence /* shall not be used within a comment
AUTOSARC++14 AUTOSARC++14:M2-7-1 The character sequence /* shall not be used within a C-style comment.
MisraC++2008 MisraC++2008:2-7-1 The character sequence /* shall not be used within a C-style comment.
MisraC++2023 MisraC++2023:5.7.1 The character sequence /* shall not be used within a C-style comment
Availability Available for C and C++.
Enabling Checks for this warning class are disabled by default. To enable them, add the following WARNING_FILTER rule to the project configuration file.
WARNING_FILTER += allow class="/* in Comment"

Example

/* body of comment does not contain C-style comment start delimiter */
/* C-style comment */  

    /* body of comment does not contain C-style comment start delimiter */
// C++-style comment  

    /* LANG.COMM.NEST.CSTYLE warning issued on following line */
/* this comment /* is not ok */

    /* LANG.COMM.NEST.CSTYLE warning issued on following line */
// this comment /* is not ok either

Relevant Configuration File Parameters

The following configuration file parameters affect checks for this warning class.