I have a simple MAKE fie that executes OK on Linux and Windows, and compiles a file containing C++-style comments (i.e., // to newline) without issue.
On zOS, the same file barfs if it encounters C++ comments, as follows:
cc -DOECS -D_OE_SOCKETS -D__UU -DPREFIX=\\"/usr\\" -o vfiled.o -c vfiled.c
ERROR CCN3046 ./vfiled.c:27 Syntax error.
ERROR CCN3334 ./vfiled.c:27 Identifier s4 has already been defined on line 26 of "./vfiled.c".
ERROR CCN3046 ./vfiled.c:57 Syntax error.
ERROR CCN3022 ./vfiled.c:57 "sin_family" is not a member of "struct sockaddr".
ERROR CCN3046 ./vfiled.c:59 Syntax error.
ERROR CCN3022 ./vfiled.c:59 "sin_port" is not a member of "struct sockaddr".
ERROR CCN3046 ./vfiled.c:62 Syntax error.
ERROR CCN3022 ./vfiled.c:62 "sa_port" is not a member of "struct sockaddr".
ERROR CCN3046 ./vfiled.c:73 Syntax error.
All of the indicated lines above contain commented-out lines; e.g.:
line 26: struct sockaddr *sa, s4;
line 27: // struct sockaddr_in s4;
OK - so I added the following to the configure script CFLAGS variable: -qcpluscmt
The compiler replies:
cc -DOECS -D_OE_SOCKETS -D__UU -qcpluscmt -DPREFIX=\\"/usr\\" -o vfiled.o -c vfiled.c
FSUM3007 -l is not a valid option.
How do I tell the compiler to allow C++ comments?
------------------------------
Roger Williams
CTO
Self Registered
Gainesville GA US
------------------------------