When C++ style comments are the default

As of z/OS® V1R7 XL C/C++, the xlc command causes the compiler to generate C++ style comments by default. This change will not normally affect your program. But in the special cases where it does (as shown in the example below), you must either override –qcpluscmt or change your source code.

In Figure 1, the intention is to increment the input by one.

Figure 1. C++ style comment
printf("%d\n",i//*something*/
+1);

Prior to z/OS V1R7 XL C/C++ compiler, the compiler saw the equivalent of: printf("%d\n", i / +1); and if the input is 4, the output is also 4.

As of z/OS V1R7 XL C/C++ compiler, the compiler sees the equivalent of: printf("%d\n", i +1); and if the input is 4, the output is 5, as intended.