Hi all
I am trying to port some open source C code that compiles fine on both Windows C and gcc. I am trying to port it into native z/OS C.
I compile using:
//STEP1 EXEC EDCCLG,CPARM2=SOURCE
The compiler is:
15647A01 V2 R10 OS/390 C
Concatenated header library:
//SYSLIB DD
X/SYSLIB DD DSNAME=&LIBPRFX..SCEEH.H,DISP=SHR
IEFC653I SUBSTITUTION JCL - DSNAME=CEE.SCEEH.H,DISP=SHR
// DD
X/ DD DSNAME=&LIBPRFX..SCEEH.SYS.H,DISP=SHR
IEFC653I SUBSTITUTION JCL - DSNAME=CEE.SCEEH.SYS.H,DISP=SHR
// DD DSN=ZATLAS1.DEV.H,DISP=SHR
In the source code I have
#include "regex.h"
which I checked and is effective and recognized. Specifically I added at a certain point this code:
#if defined REG_DUMP
static int zatest (int c)
{return c;}
#endif
and then I did
int zosprivate = zatest(1);
with no issues whatever. The errors below must be because of some incompatible usage, but I do not know where to look (my C is pretty rusty and I am trying to improve it . Please see the errors and suggest where should I go from here.
Thanks
ZA
-------------------------------
I get these errors:
214 |#ifdef REDEBUG | 214
215 |# define GOODFLAGS(f) (f) | 215
216 |#else | 216
217 |# define GOODFLAGS(f) ((f)&~REG_DUMP) | 217
218 |#endif | 218
219 | | 219
220 2 | cflags = GOODFLAGS(cflags); | 220
220 2 + cflags = ((cflags)&~REG_DUMP); + 220
===========> .....................a............................................................................
*=ERROR===========> a - CBC3045 Undeclared identifier REG_DUMP.
221 3 | if ((cflags®_EXTENDED) && (cflags®_NOSPEC)) | 221
221 3 + if ((cflags&0x001) && (cflags®_NOSPEC)) + 221
===========> ...............................a..................................................................
*=ERROR===========> a - CBC3045 Undeclared identifier REG_NOSPEC.
222 4 | return(REG_INVARG); | 222
===========> ........a.........................................................................................
*=ERROR===========> a - CBC3045 Undeclared identifier REG_INVARG.
223 | | 223
224 5 | if (cflags®_PEND) { | 224
===========> ............a.....................................................................................
*=ERROR===========> a - CBC3045 Undeclared identifier REG_PEND.
225 6 | if (preg->re_endp < pattern) | 225
===========> ............a.....................................................................................
*=ERROR===========> a - CBC3022 "re_endp" is not a member of "struct {...}".
226 7 | return(REG_INVARG); | 226
227 8 | len = preg->re_endp - pattern; | 227
===========> ..............a...................................................................................
*=ERROR===========> a - CBC3022 "re_endp" is not a member of "struct {...}".