<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Issue compiling on Itanium related to passing function pointers. in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/issue-compiling-on-itanium-related-to-passing-function-pointers/m-p/4497977#M680697</link>
    <description>Hi, I have fixed this using an extern "C" construct around the function pointer typedef. Dont know if it will give runtime issues, but compile went through fine. Anyone can let me know if this is fine to do? At least compile works :-)</description>
    <pubDate>Tue, 15 Sep 2009 23:27:17 GMT</pubDate>
    <dc:creator>ranganath_1</dc:creator>
    <dc:date>2009-09-15T23:27:17Z</dc:date>
    <item>
      <title>Issue compiling on Itanium related to passing function pointers.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/issue-compiling-on-itanium-related-to-passing-function-pointers/m-p/4497976#M680696</link>
      <description>Hi, I am in process of migrating a C/C++ APP. from PA RISC HP-UX 11.11 to Itanium V23.&lt;BR /&gt;&lt;BR /&gt;Thanks to help from Dennis and Andre, I overcame the issue with string class opened in my other thread.&lt;BR /&gt;&lt;BR /&gt; 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 *. &lt;BR /&gt;&lt;BR /&gt;Greatly appreciate your help on this.&lt;BR /&gt;&lt;BR /&gt;"TuxedoBroker.cpp", line 1189: error #2167: argument of type "AdFunction" is&lt;BR /&gt;          incompatible with parameter of type "void (*)(TPSVCINFO *) C"&lt;BR /&gt;    if(tpadvertise( (char *)serviceName.data(), svcPtr ) == TuxEvent::TUX_ERROR&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Full compile command below:&lt;BR /&gt;Compiling TuxedoBroker.cpp&lt;BR /&gt;/opt/aCC/bin/aCC -g0 -AP -v -w +z +Z +Maked +DD32 +strict   -I. -I./include -I/o&lt;BR /&gt;pt/siadev/rxrao61/SIA/common/include -I/opt/dbms/app/oracle/product/10.2_Client/&lt;BR /&gt;precomp/public -I/opt/dbms/app/oracle/product/10.2_Client/rdbms/demo -I/opt/tuxd&lt;BR /&gt;ir/tuxedo8.1/include -I/opt/siadev/slayer/include -I/usr/include  -c TuxedoBroke&lt;BR /&gt;r.cpp -o obj/TuxedoBroker.o&lt;BR /&gt; /opt/aCC/lbin/ecom -architecture 32 -makedepend file --strict_warnings -ia64abi&lt;BR /&gt; all -diag off -inst compiletime -strict on -sysdir /usr/include -inline_power 1&lt;BR /&gt; -link_type dynamic -fpeval float -fpevaldec _Decimal32 -tls_dyn on -o obj/Tuxed&lt;BR /&gt;oBroker.o -target_os 11.23 -I. -I./include -I/opt/siadev/rxrao61/SIA/common/incl&lt;BR /&gt;ude -I/opt/dbms/app/oracle/product/10.2_Client/precomp/public -I/opt/dbms/app/or&lt;BR /&gt;acle/product/10.2_Client/rdbms/demo -I/opt/tuxdir/tuxedo8.1/include -I/opt/siade&lt;BR /&gt;v/slayer/include -I/usr/include --sys_include /opt/aCC/include --sys_include /op&lt;BR /&gt;t/aCC/include/iostream --sys_include /usr/include --sys_include /usr -D_HP_IA64A&lt;BR /&gt;BI -D_BIND_LIBCALLS -D_Math_errhandling=MATH_ERREXCEPT -D__hpux -D__unix -D__ia6&lt;BR /&gt;4=1 -D__ia64__=1 -D_BIG_ENDIAN=1 -D__STDCPP__ -D_ILP32 -D__cplusplus=199711L -D_&lt;BR /&gt;_HP_aCC=62000 -D_HP_INSTANTIATE_T_IN_LIB -D_INLINE_ASM -D_FLT_EVAL_METHOD=0 -D_D&lt;BR /&gt;EC_EVAL_METHOD=0 -debug debugG -ucode hdriver=optlevel%1% -plusolistoption -Ol06&lt;BR /&gt;all! -plusolistoption -Ol13moderate! -plusooption -Oq01,al,ag,cn,sz,ic,vo,Mf,Po,&lt;BR /&gt;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&lt;BR /&gt;,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&lt;BR /&gt;b,pl,sd,ll,rl,dl,Lt,ol,fl,lm,ts,rd,dp,If! TuxedoBroker.cpp&lt;BR /&gt;"TuxedoBroker.cpp", line 1189: error #2167: argument of type "AdFunction" is&lt;BR /&gt;          incompatible with parameter of type "void (*)(TPSVCINFO *) C"&lt;BR /&gt;    if(tpadvertise( (char *)serviceName.data(), svcPtr ) == TuxEvent::TUX_ERROR&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 15 Sep 2009 15:42:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/issue-compiling-on-itanium-related-to-passing-function-pointers/m-p/4497976#M680696</guid>
      <dc:creator>ranganath_1</dc:creator>
      <dc:date>2009-09-15T15:42:16Z</dc:date>
    </item>
    <item>
      <title>Re: Issue compiling on Itanium related to passing function pointers.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/issue-compiling-on-itanium-related-to-passing-function-pointers/m-p/4497977#M680697</link>
      <description>Hi, I have fixed this using an extern "C" construct around the function pointer typedef. Dont know if it will give runtime issues, but compile went through fine. Anyone can let me know if this is fine to do? At least compile works :-)</description>
      <pubDate>Tue, 15 Sep 2009 23:27:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/issue-compiling-on-itanium-related-to-passing-function-pointers/m-p/4497977#M680697</guid>
      <dc:creator>ranganath_1</dc:creator>
      <dc:date>2009-09-15T23:27:17Z</dc:date>
    </item>
    <item>
      <title>Re: Issue compiling on Itanium related to passing function pointers.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/issue-compiling-on-itanium-related-to-passing-function-pointers/m-p/4497978#M680698</link>
      <description>&lt;!--!*#--&gt;&amp;gt; Anyone can let me know if this is fine to do?&lt;BR /&gt;&lt;BR /&gt;Perhaps someone who could see some of the&lt;BR /&gt;code would be able to guess better than I&lt;BR /&gt;can.  Compiler commands and error messages&lt;BR /&gt;are nice, but seeing the actual source code&lt;BR /&gt;might be useful, too.  Or am I missing&lt;BR /&gt;something obvious?</description>
      <pubDate>Wed, 16 Sep 2009 01:04:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/issue-compiling-on-itanium-related-to-passing-function-pointers/m-p/4497978#M680698</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2009-09-16T01:04:59Z</dc:date>
    </item>
    <item>
      <title>Re: Issue compiling on Itanium related to passing function pointers.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/issue-compiling-on-itanium-related-to-passing-function-pointers/m-p/4497979#M680699</link>
      <description>Here is the header decl. that I added the extern "C" to. This is a call to a third party vendor library - tpadvertise call. Also, I find that using -Aa option compiles this as is without need for extern "C"&lt;BR /&gt;&lt;BR /&gt;extern "C" {&lt;BR /&gt;typedef void (*AdFunction)(TPSVCINFO *);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;and the cpp file code that uses this:&lt;BR /&gt;void&lt;BR /&gt;TuxedoBroker::advertiseService( const string &amp;amp; serviceName, AdFunction svcPtr)&lt;BR /&gt;{&lt;BR /&gt;  OSCMon().debugMsg("",OSCMONTRACEMSGLOWPRIORITY,&lt;BR /&gt;                    "TuxedoBroker::advertiseService - service: [%s]\n",&lt;BR /&gt;                    serviceName.data());&lt;BR /&gt;&lt;BR /&gt;  if(tpadvertise( (char *)serviceName.data(),  svcPtr ) == TuxEvent::TUX_ERROR )</description>
      <pubDate>Wed, 16 Sep 2009 02:09:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/issue-compiling-on-itanium-related-to-passing-function-pointers/m-p/4497979#M680699</guid>
      <dc:creator>ranganath_1</dc:creator>
      <dc:date>2009-09-16T02:09:54Z</dc:date>
    </item>
    <item>
      <title>Re: Issue compiling on Itanium related to passing function pointers.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/issue-compiling-on-itanium-related-to-passing-function-pointers/m-p/4497980#M680700</link>
      <description>&lt;!--!*#--&gt;&amp;gt; Here is the header decl. that I added the&lt;BR /&gt;&amp;gt; extern "C" to. [...]&lt;BR /&gt;&lt;BR /&gt;Is that in a header file supplied by the&lt;BR /&gt;people who supplied the library, or did you&lt;BR /&gt;create it yourself?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;gt; incompatible with parameter of type "void (*)(TPSVCINFO *) C"&lt;BR /&gt;&lt;BR /&gt;Did you notice the "C" in the error message?&lt;BR /&gt;I know nothing, but I find that suggestive.</description>
      <pubDate>Wed, 16 Sep 2009 02:29:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/issue-compiling-on-itanium-related-to-passing-function-pointers/m-p/4497980#M680700</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2009-09-16T02:29:53Z</dc:date>
    </item>
    <item>
      <title>Re: Issue compiling on Itanium related to passing function pointers.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/issue-compiling-on-itanium-related-to-passing-function-pointers/m-p/4497981#M680701</link>
      <description>I added the extern C in the header where I have typedef'ed this. THis is in my header.&lt;BR /&gt;&lt;BR /&gt;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" &lt;BR /&gt;&lt;BR /&gt;but using -Aa also works without the extern "C"</description>
      <pubDate>Wed, 16 Sep 2009 02:39:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/issue-compiling-on-itanium-related-to-passing-function-pointers/m-p/4497981#M680701</guid>
      <dc:creator>ranganath_1</dc:creator>
      <dc:date>2009-09-16T02:39:53Z</dc:date>
    </item>
    <item>
      <title>Re: Issue compiling on Itanium related to passing function pointers.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/issue-compiling-on-itanium-related-to-passing-function-pointers/m-p/4497982#M680702</link>
      <description>&lt;!--!*#--&gt;&amp;gt; THis is in my header.&lt;BR /&gt;&lt;BR /&gt;Didn't they give you a header file to use?&lt;BR /&gt;(And doesn't it have this stuff in it&lt;BR /&gt;already?)</description>
      <pubDate>Wed, 16 Sep 2009 02:43:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/issue-compiling-on-itanium-related-to-passing-function-pointers/m-p/4497982#M680702</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2009-09-16T02:43:19Z</dc:date>
    </item>
    <item>
      <title>Re: Issue compiling on Itanium related to passing function pointers.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/issue-compiling-on-itanium-related-to-passing-function-pointers/m-p/4497983#M680703</link>
      <description>I need to define the function pointer on my side and pass it to their call. This is the way it is works on hp-ux 11.11 without issues</description>
      <pubDate>Wed, 16 Sep 2009 02:44:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/issue-compiling-on-itanium-related-to-passing-function-pointers/m-p/4497983#M680703</guid>
      <dc:creator>ranganath_1</dc:creator>
      <dc:date>2009-09-16T02:44:50Z</dc:date>
    </item>
    <item>
      <title>Re: Issue compiling on Itanium related to passing function pointers.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/issue-compiling-on-itanium-related-to-passing-function-pointers/m-p/4497984#M680704</link>
      <description>Since we don't know what AdFunction or tpadvertise is, you'll have to show us.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;I have fixed this using an extern "C" construct around the function pointer typedef.&lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Don't know if it will give runtime issues. Anyone can let me know if this is fine to do?&lt;BR /&gt;&lt;BR /&gt;On our implementation, the linkage is the same.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;I find that using -Aa option compiles this as is without need for extern "C"&lt;BR /&gt;&lt;BR /&gt;This shouldn't make a difference, only +strict.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;I need to define the function pointer on my side and pass it to their call.&lt;BR /&gt;&lt;BR /&gt;They should be giving you the prototype of advertiseService or tpadvertise and that should have a typedef for that pointer to function.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;aCC -AP &lt;BR /&gt;&lt;BR /&gt;If you are going to use +strict, you shouldn't be using -AP, use -AA.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Steven: Or am I missing something obvious?&lt;BR /&gt;&lt;BR /&gt;Yes, if you have had to fix a bunch of these errors, you would know.  :-)&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Did you notice the "C" in the error message? but I find that suggestive.&lt;BR /&gt;&lt;BR /&gt;Exactly.</description>
      <pubDate>Wed, 16 Sep 2009 05:57:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/issue-compiling-on-itanium-related-to-passing-function-pointers/m-p/4497984#M680704</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-09-16T05:57:40Z</dc:date>
    </item>
  </channel>
</rss>

