SSCOMM | NOSSCOMM (C only)

Category

Language element control

Pragma equivalent

None.

Purpose

Allows comments to be specified by two slashes (//), which supports C++ style comments in C code.

When the SSCOMM option is in effect, it instructs the C compiler to recognize two slashes (⁄⁄) as the beginning of a comment, which terminates at the end of the line. It will continue to recognize /*  */ as comments.

When the NOSSCOMM compiler option is in effect, /* */ is the only valid comment format.

Syntax

Read syntax diagramSkip visual syntax diagram
   .-NOSS-.   
>>-+-SS---+----------------------------------------------------><

Defaults

NOSSCOMM

For LANGLVL(STDC99) and LANGLVL(EXTC99), the default is SSCOMM.

Usage

C++ Note: You can include the same delimiter in your JCL for C++ source code, however you do not need to use the SSCOMM option.

When using the xlc command in z/OS® UNIX System Services, the equivalent option for SSCOMM is -qcpluscmt.

Predefined macros

None.

Examples

If you include your z/OS XL C program in your JCL stream, be sure to change the delimiters so that your comments are recognized as z/OS XL C comments and not as JCL statements:
//COMPILE.SYSIN DD DATA,DLM=@@
#include <stdio.h>
void main(){
// z/OS XL C comment
printf("hello world\n");
// A nested z/OS XL C /*  */ comment
}
@@
//* JCL comment