In ANSI C, you use /* and */ for commenting a code line. For example:
/* this is a comment */
You can also span a comment over multiple code lines.
/*
do {
EVNT1_HandleEvent();
cnt--;
} while (EVNT1_EventsPending() && cnt>0);
*/
However, you cannot nest comments with /* */ comments. CodeWarrior IDE marks it with ` ?' symbol.

In addition, most compilers, if not put into the strict ANSI C mode, also allow the usage of the // characters for commenting a code line.
// this is a comment too
This also allows you to comment out a line with comments.
// Function(); /* this is a call to my function*/
However, if you want to comment a whole code block, for example, the following code lines, commenting may not work for all the code lines in the block.
do {
EVNT1_HandleEvent();
cnt--; /* limit number of iterations */
} while (EVNT1_EventsPending() && cnt>0);
One way to comment a code block is to use #if 0 ... #endif.
The source file parser in CodeWarrior IDE automatically detects the `false' condition and grays out the code for better readability.
Another way is to comment/uncomment is to select the code lines you want to comment/uncomment and right-click. The following figure shows the context menu that appears.
Select Source > Comment/Uncomment from the editor context menu. The selected code lines are commented using the // characters.
cnt = 16;
//do {
//EVNT1_HandleEvent();
//cnt--; /* limit number of iterations */
//} while (EVNT1_EventsPending() && cnt>0);
} else {
Similarly, you can also uncomment the code block.
To comment code block using the /* */ characters and uncomment , use Add Block Comment and Remove Block Comment in the editor context menu.
cnt = 16;
/*
do {
EVNT1_HandleEvent();
cnt--; limit number of iterations
} while (EVNT1_EventsPending() && cnt>0);
*/
} else {
But note that, nested /* */ comments are not allowed. The CodeWarrior IDE removes the nested comment tokens, as shown in the example above. You need to check the comments in the code block after applying comment using the /* */ characters.
In addition, CodeWarrior IDE editors include comment auto-templates. For example, if you type /* in the editor and press enter, editor automatically creates a comment block for you.

You can immediately start typing your comment text inside the comment block.
To configure comment template settings:
The Preferences dialog box appears.
The template settings are configured, as specified.