Page 1 of 1

Compile error CBC3045 Undeclared identifier

PostPosted: Mon Jun 25, 2012 2:10 am
by zatlas1
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&REG_EXTENDED) && (cflags&REG_NOSPEC)) | 221
221 3 + if ((cflags&0x001) && (cflags&REG_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&REG_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 {...}".

Re: Compile error CBC3045 Undeclared identifier

PostPosted: Mon Jun 25, 2012 4:45 am
by dick scherrer
Hello,

Where ae they defined/declared? They don't appear in the code :?

Re: Compile error CBC3045 Undeclared identifier

PostPosted: Mon Jun 25, 2012 9:44 am
by zatlas1
The headers are in the //SYSLIB DD, 3rd concatenation as I've mentioned

The relevant code in regex.h (or the REGEX member) looks like this:
/* regcomp() flags */
#define REG_BASIC 0000
#define REG_EXTENDED 0001
#define REG_ICASE 0002
#define REG_NOSUB 0004
#define REG_NEWLINE 0010
#define REG_NOSPEC 0020
#define REG_PEND 0040
#define REG_DUMP 0200

Re: Compile error CBC3045 Undeclared identifier

PostPosted: Mon Jun 25, 2012 7:07 pm
by dick scherrer
Hello,

Is it possible that the member is in one of the datasets earlier in the concatenation?

Re: Compile error CBC3045 Undeclared identifier

PostPosted: Mon Jun 25, 2012 7:16 pm
by zatlas1
Thank you.
You were correct. I do not know how could I've overlooked this simple possibility.
ZA

Re: Compile error CBC3045 Undeclared identifier

PostPosted: Mon Jun 25, 2012 7:41 pm
by dick scherrer
Hello,

I do not know how could I've overlooked this simple possibility
Because you were so close to it. . . ;)

Good to hear it is resolved. Thanks for the follow up :)

d