- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Issue compiling on Itanium related to passing func...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-15-2009 08:42 AM
тАО09-15-2009 08:42 AM
Issue compiling on Itanium related to passing function pointers.
Thanks to help from Dennis and Andre, I overcame the issue with string class opened in my other thread.
Now I am stuck with a new compilation error with compiling function pointers. I am passing a function pointer (in this example svcPtr) to a third party software (bea tuxedo call) method - tpadvertise. The compiler throws error saying it is incompatible with parameter of type void *.
Greatly appreciate your help on this.
"TuxedoBroker.cpp", line 1189: error #2167: argument of type "AdFunction" is
incompatible with parameter of type "void (*)(TPSVCINFO *) C"
if(tpadvertise( (char *)serviceName.data(), svcPtr ) == TuxEvent::TUX_ERROR
Full compile command below:
Compiling TuxedoBroker.cpp
/opt/aCC/bin/aCC -g0 -AP -v -w +z +Z +Maked +DD32 +strict -I. -I./include -I/o
pt/siadev/rxrao61/SIA/common/include -I/opt/dbms/app/oracle/product/10.2_Client/
precomp/public -I/opt/dbms/app/oracle/product/10.2_Client/rdbms/demo -I/opt/tuxd
ir/tuxedo8.1/include -I/opt/siadev/slayer/include -I/usr/include -c TuxedoBroke
r.cpp -o obj/TuxedoBroker.o
/opt/aCC/lbin/ecom -architecture 32 -makedepend file --strict_warnings -ia64abi
all -diag off -inst compiletime -strict on -sysdir /usr/include -inline_power 1
-link_type dynamic -fpeval float -fpevaldec _Decimal32 -tls_dyn on -o obj/Tuxed
oBroker.o -target_os 11.23 -I. -I./include -I/opt/siadev/rxrao61/SIA/common/incl
ude -I/opt/dbms/app/oracle/product/10.2_Client/precomp/public -I/opt/dbms/app/or
acle/product/10.2_Client/rdbms/demo -I/opt/tuxdir/tuxedo8.1/include -I/opt/siade
v/slayer/include -I/usr/include --sys_include /opt/aCC/include --sys_include /op
t/aCC/include/iostream --sys_include /usr/include --sys_include /usr -D_HP_IA64A
BI -D_BIND_LIBCALLS -D_Math_errhandling=MATH_ERREXCEPT -D__hpux -D__unix -D__ia6
4=1 -D__ia64__=1 -D_BIG_ENDIAN=1 -D__STDCPP__ -D_ILP32 -D__cplusplus=199711L -D_
_HP_aCC=62000 -D_HP_INSTANTIATE_T_IN_LIB -D_INLINE_ASM -D_FLT_EVAL_METHOD=0 -D_D
EC_EVAL_METHOD=0 -debug debugG -ucode hdriver=optlevel%1% -plusolistoption -Ol06
all! -plusolistoption -Ol13moderate! -plusooption -Oq01,al,ag,cn,sz,ic,vo,Mf,Po,
es,rs,Rf,Pr,sp,in,cl,om,vc,pi,fa,pe,rr,pa,pv,nf,cp,lx,Pg,ug,lu,lb,uj,dn,sg,pt,kt
,em,np,ar,rp,dl,fs,bp,wp,pc,mp,lr,cx,cr,pi,so,Rc,fa,ft,fe,ap,st,lc,Bl,sr,Qs,do,i
b,pl,sd,ll,rl,dl,Lt,ol,fl,lm,ts,rd,dp,If! TuxedoBroker.cpp
"TuxedoBroker.cpp", line 1189: error #2167: argument of type "AdFunction" is
incompatible with parameter of type "void (*)(TPSVCINFO *) C"
if(tpadvertise( (char *)serviceName.data(), svcPtr ) == TuxEvent::TUX_ERROR
)
- Tags:
- plabel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-15-2009 04:27 PM
тАО09-15-2009 04:27 PM
Re: Issue compiling on Itanium related to passing function pointers.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-15-2009 06:04 PM
тАО09-15-2009 06:04 PM
Re: Issue compiling on Itanium related to passing function pointers.
Perhaps someone who could see some of the
code would be able to guess better than I
can. Compiler commands and error messages
are nice, but seeing the actual source code
might be useful, too. Or am I missing
something obvious?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-15-2009 07:09 PM
тАО09-15-2009 07:09 PM
Re: Issue compiling on Itanium related to passing function pointers.
extern "C" {
typedef void (*AdFunction)(TPSVCINFO *);
}
and the cpp file code that uses this:
void
TuxedoBroker::advertiseService( const string & serviceName, AdFunction svcPtr)
{
OSCMon().debugMsg("",OSCMONTRACEMSGLOWPRIORITY,
"TuxedoBroker::advertiseService - service: [%s]\n",
serviceName.data());
if(tpadvertise( (char *)serviceName.data(), svcPtr ) == TuxEvent::TUX_ERROR )
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-15-2009 07:29 PM
тАО09-15-2009 07:29 PM
Re: Issue compiling on Itanium related to passing function pointers.
> extern "C" to. [...]
Is that in a header file supplied by the
people who supplied the library, or did you
create it yourself?
> incompatible with parameter of type "void (*)(TPSVCINFO *) C"
Did you notice the "C" in the error message?
I know nothing, but I find that suggestive.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-15-2009 07:39 PM
тАО09-15-2009 07:39 PM
Re: Issue compiling on Itanium related to passing function pointers.
Yes I noticed the C and was wondering if that was becasue this is a C typedef and that is why i added the extern "C"
but using -Aa also works without the extern "C"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-15-2009 07:43 PM
тАО09-15-2009 07:43 PM
Re: Issue compiling on Itanium related to passing function pointers.
Didn't they give you a header file to use?
(And doesn't it have this stuff in it
already?)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-15-2009 07:44 PM
тАО09-15-2009 07:44 PM
Re: Issue compiling on Itanium related to passing function pointers.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-15-2009 10:57 PM
тАО09-15-2009 10:57 PM
Re: Issue compiling on Itanium related to passing function pointers.
>I have fixed this using an extern "C" construct around the function pointer typedef.
This is the correct solution. If you use +strict, you are asking for error when you violate the C vs C++ linkage of pointers to functions.
>Don't know if it will give runtime issues. Anyone can let me know if this is fine to do?
On our implementation, the linkage is the same.
>I find that using -Aa option compiles this as is without need for extern "C"
This shouldn't make a difference, only +strict.
>I need to define the function pointer on my side and pass it to their call.
They should be giving you the prototype of advertiseService or tpadvertise and that should have a typedef for that pointer to function.
>aCC -AP
If you are going to use +strict, you shouldn't be using -AP, use -AA.
>Steven: Or am I missing something obvious?
Yes, if you have had to fix a bunch of these errors, you would know. :-)
>Did you notice the "C" in the error message? but I find that suggestive.
Exactly.