Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

porting alpha to integrity

 
SOLVED
Go to solution
Saleh AlMaghrabi
Occasional Contributor

porting alpha to integrity

Hi there,
I am porting an application from alpha to integrity. I came to the point where one of the source files is not getting compiled. The error message says:
%CXX-E-NOTCOMPREDEC, declaration is incompatible with
"int (*l2func)(MBXDESC *, AKMESSINFO *) C" (declared at line 155 of
"LV2$SERVER:[SOURCE]LV2.H;13")
at line number 60 in file LV2$SERVER:[SOURCE]LV2.C;19

in LV2.c i have:
int (*l2func)(MBXDESC *mbxd, AKMESSINFO *akmess);
in lv2.h i have:
extern int (*l2func) (MBXDESC *mbxd, AKMESSINFO *akmess);
9 REPLIES 9
H.Becker
Honored Contributor

Re: porting alpha to integrity

>>> "int (*l2func)(MBXDESC *, AKMESSINFO *) C"
<<<
There seems to be more than just the shown line from your .h file: the appended 'C' in the message is very likely caused by an `extern "C" { ... }' in your .h file and the declaration of l2func being in the curly brackets.

I doubt that the compiler diagnostic is different on Alpha and Integrity. /SHOW=ALL/LIST may help to find out whether there is an `extern "C"' in effect and what's different on both platforms.
Saleh AlMaghrabi
Occasional Contributor

Re: porting alpha to integrity

thank you for the prompt reply.

Indeed i have extern c in my .h file and the the decalration is in the bracket of extern c.

what i have in the files is:
in LV2.c i have:
int (*l2func)(MBXDESC *mbxd, AKMESSINFO *akmess);
in lv2.h i have:
extern int (*l2func) (MBXDESC *mbxd, AKMESSINFO *akmess);
Steven Schweda
Honored Contributor

Re: porting alpha to integrity

> [...] from alpha to integrity. [...]

cxx /version

> [...] one of the source files [...]

If you supplied an actual test case instead
of a vague description, then someone else
might be able to investigate this.

> what i have in the files is:
> in LV2.c i have:
> int (*l2func)(MBXDESC *mbxd, AKMESSINFO *akmess);
> in lv2.h i have:
> extern int (*l2func) (MBXDESC *mbxd, AKMESSINFO *akmess);

Ok. And are these on the lines cited in the
error message? Do we know anything about
what MBXDESC and AKMESSINFO are in both
places?

> /SHOW=ALL/LIST

Often a good place to start.

One common problem with old code which
started on VAX is conditionality like
#ifdef __alpha
instead of
#ifndef __VAX
One of these usually works better than the
other on an IA64 system. But, with my weak
psychic powers, I can't see enough of your
code to do more than guess at what's
happening with it.
Ian Miller.
Honored Contributor

Re: porting alpha to integrity

are you compiling these with the same qualifiers ?

Sometimes defaults are different on Itanium.

You may find the extern model is different on Itanium.
____________________
Purely Personal Opinion
H.Becker
Honored Contributor
Solution

Re: porting alpha to integrity

I don't see any difference in extern models, here. For such incompatible declarations, the below compilers on Alpha and Integrity print the same NOTCOMPREDEC. If you didn't see the same message on Alpha, you need to find out what's different in your Integrity environment.

$ cxx/vers
HP C++ V7.2-021 on OpenVMS IA64 V8.4
$ cxx/noobj tt:
extern "C" int (*f)(int);
extern int (*f)(int);

extern int (*f)(int);
.............^
%CXX-E-NOTCOMPREDEC, declaration is incompatible with "int (*f)(int) C"
(declared at line 1)
at line number 2 in file TT:[].CXX;
Exit
Exit

%CXX-I-MESSAGE, 1 error detected in the compilation of "TT:[].CXX;".
$

$ cxx/ver
HP C++ V7.1-015 for OpenVMS Alpha V8.3
$ cxx/noobj tt:
extern "C" int (*f)(int);
extern int (*f)(int);

extern int (*f)(int);
.............^
%CXX-E-NOTCOMPREDEC, declaration is incompatible with "int (*f)(int) C"
(declared at line 1)
at line number 2 in file _VTA2562:[].CXX;
Exit

%CXX-I-MESSAGE, 1 error detected in the compilation of "_VTA2562:[].CXX;".
$

Saleh AlMaghrabi
Occasional Contributor

Re: porting alpha to integrity

Dear All,
Thank you for your effort. I've uploaded the source for your reference. I have compiled on alpha successfully.


Thank You.
H.Becker
Honored Contributor

Re: porting alpha to integrity

Obviously, with the shown simple example and default switches, there is no difference between Alpha and Integrity. It seems your environment is different from the default, at least one platform.

What are the compiler versions and the used compiler switches?

If you want someone to compile your sources, make sure that you provide all include files. There is an easy way to ensure none is forgotten: use the /preprocess qualifier.
Craig A Berry
Honored Contributor

Re: porting alpha to integrity

The line numbers in the source you posted don't match the error messages you posted, and there are several missing include files, so no one's going to be able to reproduce the exact problem.

I did notice one obvious difference between what the compiler will see on Alpha and Itanium. You've got the following lines in lv2.h:

#ifdef __ia64
#pragma member_alignment __save
#pragma nomember_alignment
#endif

If you didn't need that on Alpha, it seems unlikely you'd need it on Itanium (though I guess it's possible), and the penalty for turning off alignment would be worse.

Dennis Handly
Acclaimed Contributor

Re: porting alpha to integrity

As H.Becker said, one declaration is extern "C" and the other is extern "C++".

Any reason you don't just add extern "C" to the one in LV2.c? Or better yet, remove the redundant declaration in LV2.c.