<?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: Migrating source code from 32 to 64 bits in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/migrating-source-code-from-32-to-64-bits/m-p/4282982#M672091</link>
    <description>Have you tried compiling your code in 32 bit mode on the Itanium (leave off the +DD64) to see if it is really a 64 bit issue vs some other platform difference?&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Wed, 08 Oct 2008 16:42:02 GMT</pubDate>
    <dc:creator>Gweeper64</dc:creator>
    <dc:date>2008-10-08T16:42:02Z</dc:date>
    <item>
      <title>Migrating source code from 32 to 64 bits</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/migrating-source-code-from-32-to-64-bits/m-p/4282979#M672088</link>
      <description>Hi people!&lt;BR /&gt;I'm compiling an app. from Pa-RISC 32 bits to  Itanium 64 bits. I compile it fine (cc +DD64), linking with 64 bits libraries (i also use oracle libraries). I solved the warning messages that i didn't see when i compile under 32 bits.&lt;BR /&gt;I think all is OK. But the same program show different results that under 32 bits.&lt;BR /&gt;My questions are: Are there any kind of differences in source code (ANSI C) from 32 to 64 bits? Are the variable length equals?&lt;BR /&gt;Is the first time i have to program under 64 bits, i don't know if i have to learn something different or not!!&lt;BR /&gt;Thanks!!</description>
      <pubDate>Wed, 08 Oct 2008 08:33:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/migrating-source-code-from-32-to-64-bits/m-p/4282979#M672088</guid>
      <dc:creator>Chanquete</dc:creator>
      <dc:date>2008-10-08T08:33:09Z</dc:date>
    </item>
    <item>
      <title>Re: Migrating source code from 32 to 64 bits</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/migrating-source-code-from-32-to-64-bits/m-p/4282980#M672089</link>
      <description>&lt;!--!*#--&gt;&amp;gt; Are the variable length equals?&lt;BR /&gt;&lt;BR /&gt;Pointers aren't.  If you have doubts, write a&lt;BR /&gt;small test program, build it (both ways), and&lt;BR /&gt;run the resulting executables.  For example:&lt;BR /&gt;&lt;BR /&gt;alp $ type siz.c&lt;BR /&gt;#include &lt;STDIO.H&gt;&lt;BR /&gt;&lt;BR /&gt;main()&lt;BR /&gt;{&lt;BR /&gt;    printf( " char = %d, int = %d, long = %d, long long = %d, void* = %d.\n",&lt;BR /&gt;     sizeof( char), sizeof( int), sizeof( long),&lt;BR /&gt;     sizeof( long long), sizeof( void *));&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;gt; But the same program show different results&lt;BR /&gt;&amp;gt; that under 32 bits.&lt;BR /&gt;&lt;BR /&gt;Choose one problem and debug it.  I would&lt;BR /&gt;expect you to learn more from that experience&lt;BR /&gt;than you will from any guesses I could make&lt;BR /&gt;without being able to see any of your code.&lt;/STDIO.H&gt;</description>
      <pubDate>Wed, 08 Oct 2008 15:18:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/migrating-source-code-from-32-to-64-bits/m-p/4282980#M672089</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2008-10-08T15:18:47Z</dc:date>
    </item>
    <item>
      <title>Re: Migrating source code from 32 to 64 bits</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/migrating-source-code-from-32-to-64-bits/m-p/4282981#M672090</link>
      <description>Hi Steven!&lt;BR /&gt;I have been reading info about 64 bits programming. I see the differences about 'long' and 'pointers' length. By the moment i will steel working under 32 bits, because i'm also migrating from PA-RISC to Itanium. When my programs works fine in Itanium (under 32 bits), i will study more about 64 bits programming and the changes i have to do in my source code. It are requeriments of my boss.&lt;BR /&gt;Surely i'll ask here another questions in a future.&lt;BR /&gt;Thanks so much!!</description>
      <pubDate>Wed, 08 Oct 2008 16:13:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/migrating-source-code-from-32-to-64-bits/m-p/4282981#M672090</guid>
      <dc:creator>Chanquete</dc:creator>
      <dc:date>2008-10-08T16:13:09Z</dc:date>
    </item>
    <item>
      <title>Re: Migrating source code from 32 to 64 bits</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/migrating-source-code-from-32-to-64-bits/m-p/4282982#M672091</link>
      <description>Have you tried compiling your code in 32 bit mode on the Itanium (leave off the +DD64) to see if it is really a 64 bit issue vs some other platform difference?&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 08 Oct 2008 16:42:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/migrating-source-code-from-32-to-64-bits/m-p/4282982#M672091</guid>
      <dc:creator>Gweeper64</dc:creator>
      <dc:date>2008-10-08T16:42:02Z</dc:date>
    </item>
    <item>
      <title>Re: Migrating source code from 32 to 64 bits</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/migrating-source-code-from-32-to-64-bits/m-p/4282983#M672092</link>
      <description>oops.... never mind. I see you are trying that.&lt;BR /&gt;</description>
      <pubDate>Wed, 08 Oct 2008 16:44:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/migrating-source-code-from-32-to-64-bits/m-p/4282983#M672092</guid>
      <dc:creator>Gweeper64</dc:creator>
      <dc:date>2008-10-08T16:44:07Z</dc:date>
    </item>
    <item>
      <title>Re: Migrating source code from 32 to 64 bits</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/migrating-source-code-from-32-to-64-bits/m-p/4282984#M672093</link>
      <description>&amp;gt;PA-RISC 32 bits to Integrity 64 bits.&lt;BR /&gt;&lt;BR /&gt;There is no requirement to go to 64 bit.  You should ask your boss why he thinks 64 bit is needed??&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Is the first time I have to program under 64 bits, I don't know if I have to learn something different or not!!&lt;BR /&gt;&lt;BR /&gt;You have to port to 64 bit, i.e to do work and know what you are doing.&lt;BR /&gt;There are a +wlint +w64bit options to help you.&lt;BR /&gt;&lt;BR /&gt;Have you seen the documentation under:&lt;BR /&gt;&lt;A href="http://www.hp.com/go/cpp" target="_blank"&gt;http://www.hp.com/go/cpp&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;HP-UX 64-bit porting and transition guide&lt;BR /&gt;&lt;A href="http://h21007.www2.hp.com/portal/site/dspp/menuitem.863c3e4cbcdc3f3515b49c108973a801/?ciid=2308852bcbe02110852bcbe02110275d6e10RCRD" target="_blank"&gt;http://h21007.www2.hp.com/portal/site/dspp/menuitem.863c3e4cbcdc3f3515b49c108973a801/?ciid=2308852bcbe02110852bcbe02110275d6e10RCRD&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Steven: build it (both ways) printf(" char = %d, ... sizeof(char),&lt;BR /&gt;&lt;BR /&gt;This already violates 64 bit porting.  The correct format on HP-UX is: %ld&lt;BR /&gt;Even more pedantically: %lu&lt;BR /&gt;Or C99 perfection on 11.31: %z</description>
      <pubDate>Thu, 09 Oct 2008 03:57:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/migrating-source-code-from-32-to-64-bits/m-p/4282984#M672093</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2008-10-09T03:57:06Z</dc:date>
    </item>
    <item>
      <title>Re: Migrating source code from 32 to 64 bits</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/migrating-source-code-from-32-to-64-bits/m-p/4282985#M672094</link>
      <description>&amp;gt; This already violates 64 bit porting.&lt;BR /&gt;&lt;BR /&gt;How?  "sizeof" isn't an int?  "%d" doesn't&lt;BR /&gt;work with an int?&lt;BR /&gt;&lt;BR /&gt;Please point me to the docs which explain&lt;BR /&gt;this.</description>
      <pubDate>Thu, 09 Oct 2008 05:37:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/migrating-source-code-from-32-to-64-bits/m-p/4282985#M672094</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2008-10-09T05:37:15Z</dc:date>
    </item>
    <item>
      <title>Re: Migrating source code from 32 to 64 bits</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/migrating-source-code-from-32-to-64-bits/m-p/4282986#M672095</link>
      <description>Hi people!&lt;BR /&gt;I don't know why my boss (above the customer) loves 64 bits... I don't mind it, i only have to do what they order me!&lt;BR /&gt;I'm seeing that i'll have problems in the treatment of 'long' and pointers. When i know something more about the world where i'm entering, i'll start to ask you over and over.&lt;BR /&gt;Thanks so much!!&lt;BR /&gt;</description>
      <pubDate>Thu, 09 Oct 2008 06:50:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/migrating-source-code-from-32-to-64-bits/m-p/4282986#M672095</guid>
      <dc:creator>Chanquete</dc:creator>
      <dc:date>2008-10-09T06:50:05Z</dc:date>
    </item>
    <item>
      <title>Re: Migrating source code from 32 to 64 bits</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/migrating-source-code-from-32-to-64-bits/m-p/4282987#M672096</link>
      <description>&amp;gt;Steven: "sizeof" isn't an int?&lt;BR /&gt;&lt;BR /&gt;No, sizeof is a size_t.  On HP-UX that's a unsigned long.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Please point me to the docs which explain this.&lt;BR /&gt;&lt;BR /&gt;The C or C++ Standards?&lt;BR /&gt;&lt;A href="http://docs.hp.com/en/B3901-90020/ch05s13.html" target="_blank"&gt;http://docs.hp.com/en/B3901-90020/ch05s13.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;gt;I don't know why my boss (above the customer) loves 64 bits&lt;BR /&gt;&lt;BR /&gt;It should be clear in his mind, at least enough to explain to you.  Some valid reasons are:&lt;BR /&gt;1) Wants to port to Linux on Integrity.&lt;BR /&gt;2) Needs more address space because it is close to the 2 Gb limit.&lt;BR /&gt;3) Third party shlibs only come in 64 bit.</description>
      <pubDate>Thu, 09 Oct 2008 10:19:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/migrating-source-code-from-32-to-64-bits/m-p/4282987#M672096</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2008-10-09T10:19:30Z</dc:date>
    </item>
    <item>
      <title>Re: Migrating source code from 32 to 64 bits</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/migrating-source-code-from-32-to-64-bits/m-p/4282988#M672097</link>
      <description>Hi people!&lt;BR /&gt;I have a doubt with my code.&lt;BR /&gt;I have a 'long field' variable, and on another side i get, via Oracle SQLDA structures, data from my DB. Look at this line:&lt;BR /&gt;---   field = *(long *)std_outp-&amp;gt;V[0];&lt;BR /&gt;Really, it's a conversion from 'char **' to 'long'. It works perfectly under 32 bits. An example of my values at this point:&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;   std_outp-&amp;gt;V[0] = '989999'&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;   field          = 989999&lt;BR /&gt;But, compiled under 64 bits, it gives me:&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;   std_outp-&amp;gt;V[0] = '989999'&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;   field          = 4252013328072704&lt;BR /&gt;To do fine the 'cast', i have to type:&lt;BR /&gt;---   field = *(int *)std_outp-&amp;gt;V[0];&lt;BR /&gt;I know the problem is in the length of pointers and 'long' under 64 bits. But i find this conversion, via 'int', something 'horrible', i think that there has to be another way more 'beautiful' to do the cast. Are there?&lt;BR /&gt;Thanks in advance!</description>
      <pubDate>Thu, 09 Oct 2008 11:37:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/migrating-source-code-from-32-to-64-bits/m-p/4282988#M672097</guid>
      <dc:creator>Chanquete</dc:creator>
      <dc:date>2008-10-09T11:37:26Z</dc:date>
    </item>
    <item>
      <title>Re: Migrating source code from 32 to 64 bits</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/migrating-source-code-from-32-to-64-bits/m-p/4282989#M672098</link>
      <description>&amp;gt;I have a 'long field' variable, and on another side i get, via Oracle SQLDA structures, data from my DB. Look at this line:&lt;BR /&gt;&lt;BR /&gt;This is not a long in your database.  This is an int32_t.  You should get used to using explicit sizes in your port, especially if you have existing data files.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;field = *(long*)std_outp-&amp;gt;V[0];&lt;BR /&gt;&amp;gt;it's a conversion from 'char**' to 'long'.&lt;BR /&gt;&lt;BR /&gt;Why do you think this is a char**?  Is V a char***?&lt;BR /&gt;&lt;BR /&gt;&amp;gt;compiled under 64 bits, it gives me:&lt;BR /&gt;&amp;gt; std_outp-&amp;gt;V[0] = '989999'&lt;BR /&gt;&amp;gt; field = 4252013328072704&lt;BR /&gt;&lt;BR /&gt;You should debug this by printing both in hex.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;I find this conversion, via 'int', something 'horrible', I think that there has to be another way more 'beautiful' to do the cast.&lt;BR /&gt;&lt;BR /&gt;Cast to int32_t*.</description>
      <pubDate>Thu, 09 Oct 2008 11:57:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/migrating-source-code-from-32-to-64-bits/m-p/4282989#M672098</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2008-10-09T11:57:50Z</dc:date>
    </item>
    <item>
      <title>Re: Migrating source code from 32 to 64 bits</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/migrating-source-code-from-32-to-64-bits/m-p/4282990#M672099</link>
      <description>Hi!&lt;BR /&gt;Sorry, but i was a bit lost. Re-reading my question i realize than i was explaining so horrible. I was mixing concepts.&lt;BR /&gt;Well, SQLDA-&amp;gt;V is a char**:&lt;BR /&gt;struct SQLDA {&lt;BR /&gt;  /* ub4    */ int        N;&lt;BR /&gt;  /* text** */ char     **V;&lt;BR /&gt;  /* ub4*   */ int       *L;&lt;BR /&gt;  /* sb2*   */ short     *T;&lt;BR /&gt;  /* sb2**  */ short    **I;&lt;BR /&gt;  /* sb4    */ int        F;&lt;BR /&gt;  /* text** */ char     **S;&lt;BR /&gt;  /* ub2*   */ short     *M;&lt;BR /&gt;  /* ub2*   */ short     *C;&lt;BR /&gt;  /* text** */ char     **X;&lt;BR /&gt;  /* ub2*   */ short     *Y;&lt;BR /&gt;  /* ub2*   */ short     *Z;&lt;BR /&gt;  };&lt;BR /&gt;&lt;BR /&gt;In an Oracle's example, it uses also this cast (to convert to '%d' value to printf):&lt;BR /&gt;         *(int *)select_dp-&amp;gt;V[i]&lt;BR /&gt;when the field has a NUMBER value.&lt;BR /&gt;&lt;BR /&gt;If Oracle does it, i'll do it.&lt;BR /&gt;&lt;BR /&gt;Thanks a lot!</description>
      <pubDate>Fri, 10 Oct 2008 05:47:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/migrating-source-code-from-32-to-64-bits/m-p/4282990#M672099</guid>
      <dc:creator>Chanquete</dc:creator>
      <dc:date>2008-10-10T05:47:38Z</dc:date>
    </item>
    <item>
      <title>Re: Migrating source code from 32 to 64 bits</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/migrating-source-code-from-32-to-64-bits/m-p/4282991#M672100</link>
      <description>&amp;gt;SQLDA-&amp;gt;V is a char**:&lt;BR /&gt;&lt;BR /&gt;So V[0] is a char* and you were converting a char* to a long*, then dereferencing it.</description>
      <pubDate>Fri, 10 Oct 2008 06:04:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/migrating-source-code-from-32-to-64-bits/m-p/4282991#M672100</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2008-10-10T06:04:38Z</dc:date>
    </item>
    <item>
      <title>Re: Migrating source code from 32 to 64 bits</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/migrating-source-code-from-32-to-64-bits/m-p/4282992#M672101</link>
      <description>Oh, sorry, Dennis. You're so right!&lt;BR /&gt;But i have important news: my customer hear my words (i'm influential...) and we discard at the moment migrate the application to 64-bit.&lt;BR /&gt;And now we have a trouble:&lt;BR /&gt;Anybody knows something about the future of 32-bit in HP-UX? If the HP's future plan is not include 32-bit compatibility, we can think about 64-bit porting.&lt;BR /&gt;Thanks a lot, people!</description>
      <pubDate>Fri, 10 Oct 2008 08:42:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/migrating-source-code-from-32-to-64-bits/m-p/4282992#M672101</guid>
      <dc:creator>Chanquete</dc:creator>
      <dc:date>2008-10-10T08:42:57Z</dc:date>
    </item>
    <item>
      <title>Re: Migrating source code from 32 to 64 bits</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/migrating-source-code-from-32-to-64-bits/m-p/4282993#M672102</link>
      <description>&amp;gt;Anybody knows something about the future of 32-bit in HP-UX? If the HP's future plan is not include 32-bit compatibility&lt;BR /&gt;&lt;BR /&gt;There are no current plans to change this.&lt;BR /&gt;Perhaps when there are 128 bit computers.  :-)</description>
      <pubDate>Fri, 10 Oct 2008 19:03:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/migrating-source-code-from-32-to-64-bits/m-p/4282993#M672102</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2008-10-10T19:03:39Z</dc:date>
    </item>
  </channel>
</rss>

