<?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 malloc declaration? in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/malloc-declaration/m-p/742952#M1898</link>
    <description>Should you declare theelemental intrinsic function malloc in a program? Is the declaration in this example appropriate for the 64 bit compiler? I am using a program that declares malloc as an integer that is compiled 64 bit and is working fine. Is the declaration correct, ignored, or have I just been lucky? I believe p1 and p1 are correct just not sure how to handle the declaration (if it is needed or required) of malloc.
&lt;DIV&gt;&lt;SPAN style="font-family: Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;
&lt;PRE&gt;[cpp]      program mem
      implicit none
      integer malloc,i       &amp;lt;==== malloc declaration
      
      pointer (p1, fred)
      pointer (p2, jack)
      integer size
      real fred(*),jack(*)

      print *,'How big?'
      read *,size

      p1 = malloc(4*size)
      p2 = malloc(4*size)

      do i=1,(size)
              fred(i)=i
              jack(i)=i
      end do
      print *,jack(size),fred(size)
      end
[/cpp]&lt;/PRE&gt;
&lt;BR /&gt;&lt;/DIV&gt;</description>
    <pubDate>Sat, 09 Jan 2010 00:07:04 GMT</pubDate>
    <dc:creator>chauvjo</dc:creator>
    <dc:date>2010-01-09T00:07:04Z</dc:date>
    <item>
      <title>malloc declaration?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/malloc-declaration/m-p/742952#M1898</link>
      <description>Should you declare theelemental intrinsic function malloc in a program? Is the declaration in this example appropriate for the 64 bit compiler? I am using a program that declares malloc as an integer that is compiled 64 bit and is working fine. Is the declaration correct, ignored, or have I just been lucky? I believe p1 and p1 are correct just not sure how to handle the declaration (if it is needed or required) of malloc.
&lt;DIV&gt;&lt;SPAN style="font-family: Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;
&lt;PRE&gt;[cpp]      program mem
      implicit none
      integer malloc,i       &amp;lt;==== malloc declaration
      
      pointer (p1, fred)
      pointer (p2, jack)
      integer size
      real fred(*),jack(*)

      print *,'How big?'
      read *,size

      p1 = malloc(4*size)
      p2 = malloc(4*size)

      do i=1,(size)
              fred(i)=i
              jack(i)=i
      end do
      print *,jack(size),fred(size)
      end
[/cpp]&lt;/PRE&gt;
&lt;BR /&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 09 Jan 2010 00:07:04 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/malloc-declaration/m-p/742952#M1898</guid>
      <dc:creator>chauvjo</dc:creator>
      <dc:date>2010-01-09T00:07:04Z</dc:date>
    </item>
    <item>
      <title>Re: malloc declaration?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/malloc-declaration/m-p/742953#M1899</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;BR /&gt;You should not declare malloc, but if you want to, do it this way:&lt;BR /&gt;&lt;BR /&gt;integer(int_ptr_kind()) malloc&lt;BR /&gt;&lt;BR /&gt;Your declaration is ignored if it is an intrinsic.&lt;BR /&gt;&lt;BR /&gt;This will be correct on both 32 and 64-bit systems.&lt;BR /&gt;</description>
      <pubDate>Sat, 09 Jan 2010 14:14:22 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/malloc-declaration/m-p/742953#M1899</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2010-01-09T14:14:22Z</dc:date>
    </item>
  </channel>
</rss>

