I apologize for a stupid question, but even after few hours of reading the code and header files, I could not find any explanation for this phenomena.
Could somebody be kind and explain what is going on with the DECC on x86 around getline and getdelim functions?
Background: I am porting an open source project to x86VMS
The very same code works well on VAX, Alpha and Itanium.
Tested with the following compilers - and the program builds and works very well:
Compaq C V6.4-005 on OpenVMS VAX V7.3
HP C V7.3-020 on OpenVMS IA64 V8.4
Compaq C V6.5-001 on OpenVMS Alpha V7.3
VSI C V7.4-002 on OpenVMS Alpha V8.4-2L1
...but on x86 it fails with a very strange error.
I use: VSI C x86-64 X7.4-843 (GEM 50XB9) on OpenVMS x86_64 V9.2-1
Code: Select all
line = cp->getline(c, cp->cookie, indent, options);
...............................^
%CC-W-TOOMANYACTLS, Too many actual parameters in the invocation of the macro "getline".
line = cp->getline(c, cp->cookie, indent, options);
...................^
%CC-E-NEEDMEMBER, In this statement, "getdelim" is not a member of "cp".
Second: the getdelim function is not used anywhere in the code, regardless the compiler complies about a missing member.
Without getting deep in the far too complicated piece of code, let's describe the issue on a simple way:
There is a given structure:
Code: Select all
struct loop_cookie
{
int current_line;
int repeating;
char_u *(*getline)(int, void *, int, getline_opt_T);
void *cookie;
};
The struct is used in the following way:
struct loop_cookie *cp = (struct loop_cookie *)cookie;
line = cp->getline(c, cp->cookie, indent, options);
Code: Select all
struct loop_cookie
{
int current_line;
int repeating;
char_u *(*getline)(int, void *, int, getline_opt_T);
#if defined (VMS) || defined (X86_64)
char_u *(*getdelim)(int, void *, int, getline_opt_T);
#endif
void *cookie;
};
Code: Select all
line = cp->getline(c, cp->cookie, indent, options);
...............................^
%CC-W-TOOMANYACTLS, Too many actual parameters in the invocation of the macro "getline".
The getline and getdelim basically differs just in number of parameters and what is the line delimiter. This might cause the issues... but I do not understand how the getdelim() comes into the picture at all (just in X86VMS)?
Any explanation or a workaround suggestion would be highly appreciated.
Thanks,
Z