Trying to compile a program on OMVS. The same code compile fine on z/Linux with gcc . Run the same compile on OMVS using XLC and XLC chocks with;
ERROR CCN3277 /u/tonyi/svn/branches/18.0/svn/apl/allos/src/p_macros.h:58 Syntax error: possible missing ';' or ','?
ERROR CCN3485 /u/tonyi/svn/branches/18.0/svn/apl/allos/src/p_macros.h:57 Parameter declaration list is incompatible with declarator for inline.
ERROR CCN3045 /u/tonyi/svn/branches/18.0/svn/apl/allos/src/p_macros.h:67 Undeclared identifier pp.
ERROR CCN3277 /u/tonyi/svn/branches/18.0/svn/apl/allos/src/p_macros.h:76 Syntax error: possible missing ';' or ','?
ERROR CCN3485 /u/tonyi/svn/branches/18.0/svn/apl/allos/src/p_macros.h:75 Parameter declaration list is incompatible with declarator for inline.
ERROR CCN3045 /u/tonyi/svn/branches/18.0/svn/apl/allos/src/p_macros.h:100 Undeclared identifier ip.
ERROR CCN3045 /u/tonyi/svn/branches/18.0/svn/apl/allos/src/p_macros.h:100 Undeclared identifier size.
ERROR CCN3277 /u/tonyi/svn/branches/18.0/svn/apl/allos/src/p_macros.h:170 Syntax error: possible missing ';' or ','?
ERROR CCN3485 /u/tonyi/svn/branches/18.0/svn/apl/allos/src/p_macros.h:169 Parameter declaration list is incompatible with declarator for inline.
ERROR CCN3045 /u/tonyi/svn/branches/18.0/svn/apl/allos/src/p_macros.h:177 Undeclared identifier pp.
ERROR CCN3277 /u/tonyi/svn/branches/18.0/svn/apl/allos/src/p_macros.h:185 Syntax error: possible missing ';' or ','?
ERROR CCN3485 /u/tonyi/svn/branches/18.0/svn/apl/allos/src/p_macros.h:184 Parameter declaration list is incompatible with declarator for inline.
ERROR CCN3045 /u/tonyi/svn/branches/18.0/svn/apl/allos/src/p_macros.h:193 Undeclared identifier ppp.
ERROR CCN3277 /u/tonyi/svn/branches/18.0/svn/apl/allos/src/p_macros.h:198 Syntax error: possible missing ';' or ','?
ERROR CCN3485 /u/tonyi/svn/branches/18.0/svn/apl/allos/src/p_macros.h:198 Parameter declaration list is incompatible with declarator for inline.
ERROR CCN3045 /u/tonyi/svn/branches/18.0/svn/apl/allos/src/p_macros.h:199 Undeclared identifier p.
ERROR CCN3277 /u/tonyi/svn/branches/18.0/svn/apl/allos/src/p_macros.h:208 Syntax error: possible missing ';' or ','?
ERROR CCN3485 /u/tonyi/svn/branches/18.0/svn/apl/allos/src/p_macros.h:207 Parameter declaration list is incompatible with declarator for inline.
ERROR CCN3045 /u/tonyi/svn/branches/18.0/svn/apl/allos/src/p_macros.h:238 Undeclared identifier p.
ERROR CCN3045 /u/tonyi/svn/branches/18.0/svn/apl/allos/src/p_macros.h:239 Undeclared identifier pptr.
ERROR CCN3277 /u/tonyi/svn/branches/18.0/svn/apl/allos/src/p_macros.h:244 Syntax error: possible missing ';' or ','?
ERROR CCN3485 /u/tonyi/svn/branches/18.0/svn/apl/allos/src/p_macros.h:243 Parameter declaration list is incompatible with declarator for inline.
ERROR CCN3045 /u/tonyi/svn/branches/18.0/svn/apl/allos/src/p_macros.h:253 Undeclared identifier p.
ERROR CCN3045 /u/tonyi/svn/branches/18.0/svn/apl/allos/src/p_macros.h:253 Undeclared identifier off.
ERROR CCN3045 /u/tonyi/svn/branches/18.0/svn/apl/allos/src/p_macros.h:254 Undeclared identifier len.
The p_macros.h file is; Note I have only highlighted the first coupler of errors
#define initlarg(htype)
initsget(&LARG,&kLarg,htype)
#define initlargx(htype,dmx)
initsgetx(&LARG,&kLarg,htype,dmx)
#define initrarg(htype)
initsget(&RARG,&kRarg,htype)
#define initrargx(htype,dmx)
initsgetx(&RARG,&kRarg,htype,dmx)
#define inittemp(htype)
initsget(&TEMP,&kTemp,htype)
#define inittempx(htype,dmx)
initsgetx(&TEMP,&kTemp,htype,dmx)
#define initsptr(S)
((S)->ptr.sp=(S)->firstelt.sp,(S)->boolmask=initbool)
#define relqref(ppp)
(--(*ppp)->REFCOUNT, *ppp = 0)
{ \
if (*ppp) \
{ \
if (--(*(ppp))->REFCOUNT) \
*(ppp) = 0; \
else \
{ \
++(*(ppp))->REFCOUNT; \
relpref(ppp); \
} \
} \
}
// double coercion below is just for the benefit of the wsdump code
#define ispntr(P)
((UPTR)(uintptr_t)(P) >= MIN_PTR)
#if !AP_BUILD && !BRIDGE_BUILD
extern void _relpref(PP *pptr);
static FORCEINLINE void relpock(PP *pp) // stmt 57
{ // stmt 58
if (*pp)
_relpref(pp);
}
static FORCEINLINE void relkeep(PP *pp)
{
if (*pp) //stmt 67
{
((KEEPSTR*)pp)->keeptr.cp = 0; // zap PTR
((KEEPSTR*)pp)->keepsp = 0; // zap SERIAL*.
_relpref(pp);
}
}
static FORCEINLINE void relpref(PP *pp)
{ // stmt 76
if (ispntr(*pp))
{
if (pp > &KEEP(0) && pp <= &KEEP(NKEEPS - 1)) // It's a KEEP,
{
((KEEPSTR*)pp)->keeptr.cp = 0; // zap PTR
((KEEPSTR*)pp)->keepsp = 0; // zap SERIAL*.
}
_relpref(pp);
}
else *pp=0;
}
////////////////////////////////////////////////////////////////////////////////
// //
// Low-level heap-manager (aka memory-manager) pocket-release code. //
//
extern void add_spock (MEMORYINT *p); // memory1.h not yet included
extern void wsptr_dragback(MEMORYINT *ip, MEMORYINT size);
static FORCEINLINE void mm_free(MEMORYINT *ip, MEMORYINT size) //
{ //
*ip = size; //
wsptr_dragback(ip,size);
(void)MM_GUI_FREED(ip,size);
if (size <= SPOCKS_SZ)
add_spock (ip);
} //
//
////////////////////////////////////////////////////////////////////////////////
#endif //!AP_BUILD && !BRIDGE_BUILD
#define reldesp()
relpref(&DESPERATE)
#define pocktyp(pock)
((pock)->TYPE)
#define typesym(pock)
((pock)->TYPE==TYPESYMBOL)
#define typefun(pock)
((pock)->TYPE==TYPEDEFUNCT)
#define typefptr(pock)
((pock)->TYPE==TYPEFPTR)
#define typegen(pock)
((pock)->TYPE==TYPEGEN)
#define typesim(pock)
((pock)->TYPE==TYPESIMPLE)
#define DUP(to,from)
++(*(to) = *(from))->REFCOUNT
#define DUPV(to,from)
++(*(to) = (from))->REFCOUNT
#define DUPC(to,from)
(from) ? ++(*(to) = (from))->REFCOUNT : 0
#if !AP_BUILD && !_MANAGED && !defined(JAVA_BRIDGE)
extern BOUND bndcalc(MEMORYUNS rank,BOUND *sptr);
extern unsigned int IsRef(PP ref);
#define Bound1(p)
((p)->SHAPETC[affirm ((p)->RANK == 1), 0])
#define Bound01(p)
((p)->RANK==0?1:Bound1(p))
#define Bound(p)
((p) ? (IsRef(p)?1:fast_bndcalc(p)) : 0)
#endif //!AP_BUILD && !_MANAGED
#if WANT_REFCOUNTS && !BRIDGE_BUILD
//////////////////////////////////////////////////////////////////
// //
// note the use of PP macros/functions: //
// //
// ref(PP) bump refcount and return ptr to value. //
// zap(PP) zero ptr and return its old value. //
// rel(PP) release lvalue and return ptr to its addr. //
// //
// eg: //
// Temp = ref(Larg); // DUPV(&Temp, Larg); //
// Temp = zap(Larg); // MOVEPP(Temp, Larg); //
// rel(Temp) = ref(Larg); // reltemp(), DUVP(&Temp, Larg);//
// //
// refc() is a conditional version of ref(), //
// which can accommodate non-ptr args. //
// //
//////////////////////////////////////////////////////////////////
extern C_EXTERN void relpref(PP *pp); // DWA has no direct access to relpref/_relpref needs to call back
// into the interpreter
static FORCEINLINE PP ref(PP pp) // DUPV(&to,fm) => to=ref(fm)
{
++pp->REFCOUNT;
return pp;
}
static FORCEINLINE PP refc(PP pp) // DUPC(&to,fm) => to=ref(fm)
{
return ispntr(pp) ? ref(pp) : pp;
}
#define zap(pp) _zap(&(pp))
// MOVEPP(to,fm) => to=zap(fm)
#define rel(pp) (*_rel(&(pp)))
// e.g. rel(Larg)=ref(p)
static FORCEINLINE PP *_rel(PP *ppp)
{
if (ispntr(*ppp))
relpref(ppp);
return ppp;
}
static FORCEINLINE PP _zap(PP *ppp)
{
PP pp = *ppp;
*ppp = 0;
return pp;
}
static FORCEINLINE void reset_nonsquoze(PP p) { p->SORTED_UP = p->SORTED_DOWN = 0; }
static FORCEINLINE void reset_flags(PP p) { p->SQUOZE = 0; reset_nonsquoze(p); }
#define reuse_arr(pp) (reset_flags(pp), zap(pp))
#define reuse_keepsquoze(pp) (reset_nonsquoze(pp), zap(pp))
#if !AP_BUILD // APs don't know about keeps
static FORCEINLINE PP _zapk(PP *ppp)
{
PP pp;
ZAPSP(*ppp);
pp = *ppp;
*ppp = 0;
return pp;
}
//////////////////////////////////////////////////////////////////////////
// //
// The following (inlined) fn should be slightly slicker than a macro, //
// Only WE know that relpref can't move pptr; the optimiser //
// would have to evaluate pptr twice. //
// //
//////////////////////////////////////////////////////////////////////////
// GRS 2017-08-18. This code is dubious in a number of ways.
// 1. relpref is sensitive to REFCOUNT values and the pre-increment could
// cause issues
// 2. Whereas relpref worries about KEEPs it does not worry about LOCALP
// both have pointers to SERIAL.
// I tried a version that allocated a local PP and relpref'd that. However,
// 1. Windows compiler thought that might change 4 bytes beyond (because it
// might be a KEEP
// 2. If it really was a KEEP it would not do the necessary with KEEPSP
static FORCEINLINE void REPLACE(PP *pptr, PP p)
{
++p->REFCOUNT; // pre-increment in case *pptr==p
relpref(pptr);
*pptr = p;
}
static FORCEINLINE void REPLACEC(PP *pptr, PP p)
{
if (ispntr(p)) ++p->REFCOUNT; // pre-increment in case *pptr==p
relpref(pptr);
*pptr = p;
}
static INLINE void increfs(PP p, BOUND off, BOUND len)
{
PP *refs = p->PSHAPETC + off;
for (BOUND i=0; i<len; i++)
ref(refs[i]);
}
#define increfs_coalesce(pock, off, len) do { \
increfs(pock, off, len); \
coalesce(&pock); \
} while (0)
Now I am almost bald with frustration over this. So if anybody can shed any light onto what the problem is or why XLC gets upset, please, please enlighten me.