<?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 C++ and FORTRAN strings on x64 in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/C-and-FORTRAN-strings-on-x64/m-p/831584#M52740</link>
    <description>&lt;P&gt;I have a problem which occurs on x64 but not win32. I have a c++ routine which declares a character string&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;char string[16]&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;and passes it to fortran which gives string a value&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;string = 'abc'&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;This results in an error: "&lt;FONT face="Arial"&gt;A buffer overrun has occurred in post.exe which has corrupted the program's internal state. Press Break to debug the program or Continue to terminate the program."&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;If I change the code to&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;string(1:len(string)) = 'abc'&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;the error changes to "&lt;FONT face="Arial"&gt;Variable STRING has substring ending point 16 which is greater than the variable length of 16&lt;/FONT&gt;".&lt;/P&gt;
&lt;P&gt;I cannt reproduce either error in 10 lines of code, so it's difficult for support to help me. Any ideas or work-arounds would be most welcome.&lt;/P&gt;</description>
    <pubDate>Tue, 10 Apr 2007 11:46:47 GMT</pubDate>
    <dc:creator>chris_biddlecombe</dc:creator>
    <dc:date>2007-04-10T11:46:47Z</dc:date>
    <item>
      <title>C++ and FORTRAN strings on x64</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/C-and-FORTRAN-strings-on-x64/m-p/831584#M52740</link>
      <description>&lt;P&gt;I have a problem which occurs on x64 but not win32. I have a c++ routine which declares a character string&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;char string[16]&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;and passes it to fortran which gives string a value&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;string = 'abc'&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;This results in an error: "&lt;FONT face="Arial"&gt;A buffer overrun has occurred in post.exe which has corrupted the program's internal state. Press Break to debug the program or Continue to terminate the program."&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;If I change the code to&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;string(1:len(string)) = 'abc'&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;the error changes to "&lt;FONT face="Arial"&gt;Variable STRING has substring ending point 16 which is greater than the variable length of 16&lt;/FONT&gt;".&lt;/P&gt;
&lt;P&gt;I cannt reproduce either error in 10 lines of code, so it's difficult for support to help me. Any ideas or work-arounds would be most welcome.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Apr 2007 11:46:47 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/C-and-FORTRAN-strings-on-x64/m-p/831584#M52740</guid>
      <dc:creator>chris_biddlecombe</dc:creator>
      <dc:date>2007-04-10T11:46:47Z</dc:date>
    </item>
    <item>
      <title>Re: C++ and FORTRAN strings on x64</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/C-and-FORTRAN-strings-on-x64/m-p/831585#M52741</link>
      <description>&lt;P&gt;If your C++ code expects a null terminated string, you should initialize it accordingly. Aside from special facilities of ifort, you might use 'abc'//achar(0)&lt;/P&gt;
&lt;P&gt;You might have been lucky in the 32-bit version to have an acceptable terminating character appear in the buffer.&lt;/P&gt;
&lt;P&gt;I'm guessing, as that's about all that can be done with the information you presented.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Apr 2007 12:31:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/C-and-FORTRAN-strings-on-x64/m-p/831585#M52741</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2007-04-10T12:31:30Z</dc:date>
    </item>
    <item>
      <title>Re: C++ and FORTRAN strings on x64</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/C-and-FORTRAN-strings-on-x64/m-p/831586#M52742</link>
      <description>&lt;P&gt;How is string declared on the Fortran side?&lt;/P&gt;
&lt;P&gt;If it is (0:15) as opposed to (1:16) then you may see this problem.&lt;/P&gt;
&lt;P&gt;The IFORT documentation is not clear on this issue. I suggest placing a break point on the assignment causing the problem. Then examin STRING in the debugger to find the array indicies (see if it is 0:15 or 1:16, or something else).&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Apr 2007 13:01:40 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/C-and-FORTRAN-strings-on-x64/m-p/831586#M52742</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2007-04-10T13:01:40Z</dc:date>
    </item>
    <item>
      <title>Re: C++ and FORTRAN strings on x64</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/C-and-FORTRAN-strings-on-x64/m-p/831587#M52743</link>
      <description>stringis declared as &lt;FONT face="Courier New"&gt;character*(*)&lt;/FONT&gt; in the fortran,the real length being passed as a hidden argument. The LEN function returns the correct value (16). The debugger knows that the argument to the routine is &lt;FONT face="Courier New"&gt;CHARACTER(16)&lt;/FONT&gt;. I cannot see any way of looking at the string indices in the debugger. However, if I try to set characters 1 to 15 (which should be safe, it tells me that "substring ending point 15 is greater than 16"!</description>
      <pubDate>Tue, 10 Apr 2007 13:35:12 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/C-and-FORTRAN-strings-on-x64/m-p/831587#M52743</guid>
      <dc:creator>chris_biddlecombe</dc:creator>
      <dc:date>2007-04-10T13:35:12Z</dc:date>
    </item>
    <item>
      <title>Re: C++ and FORTRAN strings on x64</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/C-and-FORTRAN-strings-on-x64/m-p/831588#M52744</link>
      <description>Fortran should not need a null character to tell it how long string is. The debugger knows it is CHARACTER(16) and the LEN function gets that right too. But how can 16 be greater than 16? If I try setting characters 1 to 15, it tells me that 15 is greater than 16!</description>
      <pubDate>Tue, 10 Apr 2007 13:37:42 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/C-and-FORTRAN-strings-on-x64/m-p/831588#M52744</guid>
      <dc:creator>chris_biddlecombe</dc:creator>
      <dc:date>2007-04-10T13:37:42Z</dc:date>
    </item>
    <item>
      <title>Re: C++ and FORTRAN strings on x64</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/C-and-FORTRAN-strings-on-x64/m-p/831589#M52745</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;DIV&gt;&lt;IMG src="https://community.intel.com/file/6745" /&gt; &lt;STRONG&gt;Chris.Biddlecombe@vectorfields.co.uk:&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;The debugger knows it is CHARACTER(16) and the LEN function gets that right too. But how can 16 be greater than 16? If I try setting characters 1 to 15, it tells me that 15 is greater than 16!&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;Try 17, then &lt;IMG src="https://community.intel.com/isn/Community/en-US/emoticons/emotion-4.gif" alt="Smiley with tongue out [:-P]" /&gt;&lt;BR /&gt;&lt;BR /&gt;But seriously, this now sounds like an issue for Premier support; either you discovered a compiler bug, or you made a fandango on core elsewhere.&lt;BR /&gt;</description>
      <pubDate>Tue, 10 Apr 2007 14:41:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/C-and-FORTRAN-strings-on-x64/m-p/831589#M52745</guid>
      <dc:creator>Jugoslav_Dujic</dc:creator>
      <dc:date>2007-04-10T14:41:30Z</dc:date>
    </item>
  </channel>
</rss>

