<?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: C pointer problem on IA64 but not on pa-risc in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/c-pointer-problem-on-ia64-but-not-on-pa-risc/m-p/3633886#M104960</link>
    <description>I'll go a bit further. Your old code was working by accident. It is state of the art dumb, sloppy, and in bad taste to leave out those silly, useless header files. The reason your old code was working is that all undeclared extern functions (which was your situation w/o the declaration in the header file) are assumed to be of type int. In 10.20, both pointers and int's are 32-bit types but in your newer OS ints remain at 32 bits but pointers are 64-bits so with the extern malloc() undeclared, the compiler assumed that it was an int function and missed half of the pointer bits.&lt;BR /&gt;&lt;BR /&gt;If you had even bothered to run your 10.20 code through lint, it would have told you that a potential problem exists.</description>
    <pubDate>Mon, 26 Sep 2005 12:35:21 GMT</pubDate>
    <dc:creator>A. Clay Stephenson</dc:creator>
    <dc:date>2005-09-26T12:35:21Z</dc:date>
    <item>
      <title>C pointer problem on IA64 but not on pa-risc</title>
      <link>https://community.hpe.com/t5/operating-system-linux/c-pointer-problem-on-ia64-but-not-on-pa-risc/m-p/3633882#M104956</link>
      <description>Hi all,&lt;BR /&gt;&lt;BR /&gt;We're moving an app from a D370 PA-Risc machine running HP-UX 10.20 to an ia64 machine with HP-UX 11iv2.  I know the answer to my problem is documented somewhere - I can't find it.&lt;BR /&gt;&lt;BR /&gt;The attached sample program runs fine on the d370 machine. Moving the executable onto the ia64 runs fine. However, when recompiled on the ia64 box, I get a memory dump at the point indicated in the source.&lt;BR /&gt;&lt;BR /&gt;I'm sure it must have something to do with 64bit vs. 32bit, but can't find it.  Any help would be greatly appreciated!&lt;BR /&gt;&lt;BR /&gt;(The attached code is actually a striped-down version of a larger program.)&lt;BR /&gt;&lt;BR /&gt;Thanks!&lt;BR /&gt;&lt;BR /&gt;mike</description>
      <pubDate>Fri, 23 Sep 2005 22:33:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/c-pointer-problem-on-ia64-but-not-on-pa-risc/m-p/3633882#M104956</guid>
      <dc:creator>Michael Resnick</dc:creator>
      <dc:date>2005-09-23T22:33:33Z</dc:date>
    </item>
    <item>
      <title>Re: C pointer problem on IA64 but not on pa-risc</title>
      <link>https://community.hpe.com/t5/operating-system-linux/c-pointer-problem-on-ia64-but-not-on-pa-risc/m-p/3633883#M104957</link>
      <description>I don't see any attachment, could you add it so we can take a look? Thanks.</description>
      <pubDate>Sat, 24 Sep 2005 08:14:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/c-pointer-problem-on-ia64-but-not-on-pa-risc/m-p/3633883#M104957</guid>
      <dc:creator>Don Morris_1</dc:creator>
      <dc:date>2005-09-24T08:14:11Z</dc:date>
    </item>
    <item>
      <title>Re: C pointer problem on IA64 but not on pa-risc</title>
      <link>https://community.hpe.com/t5/operating-system-linux/c-pointer-problem-on-ia64-but-not-on-pa-risc/m-p/3633884#M104958</link>
      <description>I found a note somewhere that said to include &lt;STDLIB.H&gt; to correct a memory allocation problem with malloc.  Sure enough, once that was included, the program started working.&lt;/STDLIB.H&gt;</description>
      <pubDate>Sat, 24 Sep 2005 12:16:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/c-pointer-problem-on-ia64-but-not-on-pa-risc/m-p/3633884#M104958</guid>
      <dc:creator>Michael Resnick</dc:creator>
      <dc:date>2005-09-24T12:16:44Z</dc:date>
    </item>
    <item>
      <title>Re: C pointer problem on IA64 but not on pa-risc</title>
      <link>https://community.hpe.com/t5/operating-system-linux/c-pointer-problem-on-ia64-but-not-on-pa-risc/m-p/3633885#M104959</link>
      <description>It is good you added that include - particularly since the manpage for malloc suggests that it is supposed to be there in the first place :)&lt;BR /&gt;&lt;BR /&gt;If you are migrating to 64-bit, there are some migration compilation options in the compiler you may want to enable.  IIRC it is the +M option, but best double check the cc manpage on that one.&lt;BR /&gt;&lt;BR /&gt;However, unless you are explicitly stating +DD64, the default compilation mode for IA64 remains 64-bit.</description>
      <pubDate>Mon, 26 Sep 2005 11:48:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/c-pointer-problem-on-ia64-but-not-on-pa-risc/m-p/3633885#M104959</guid>
      <dc:creator>rick jones</dc:creator>
      <dc:date>2005-09-26T11:48:51Z</dc:date>
    </item>
    <item>
      <title>Re: C pointer problem on IA64 but not on pa-risc</title>
      <link>https://community.hpe.com/t5/operating-system-linux/c-pointer-problem-on-ia64-but-not-on-pa-risc/m-p/3633886#M104960</link>
      <description>I'll go a bit further. Your old code was working by accident. It is state of the art dumb, sloppy, and in bad taste to leave out those silly, useless header files. The reason your old code was working is that all undeclared extern functions (which was your situation w/o the declaration in the header file) are assumed to be of type int. In 10.20, both pointers and int's are 32-bit types but in your newer OS ints remain at 32 bits but pointers are 64-bits so with the extern malloc() undeclared, the compiler assumed that it was an int function and missed half of the pointer bits.&lt;BR /&gt;&lt;BR /&gt;If you had even bothered to run your 10.20 code through lint, it would have told you that a potential problem exists.</description>
      <pubDate>Mon, 26 Sep 2005 12:35:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/c-pointer-problem-on-ia64-but-not-on-pa-risc/m-p/3633886#M104960</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2005-09-26T12:35:21Z</dc:date>
    </item>
  </channel>
</rss>

