<?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 Quote:Repeat Offender wrote: in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/64-bit-C-to-FORTRAN-character-interface-issue/m-p/1089414#M123839</link>
    <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;Repeat Offender wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;.. To change it from the C side you need a macro that sets the type of the hidden LEN parameter (size_t doesn't cut it) and ..&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;The above comment does not make sense. &amp;nbsp;From what I understand, size_t in C is an unsigned integer of a certain minimum size to represent the size of objects. &amp;nbsp;And Microsoft documentation indicates size_t is an&amp;nbsp;unsigned __int64 or unsigned integer, depending on the target platform. &amp;nbsp;So I'm not sure why size_t won't "cut it" - it seems the most natural, standard way to represent the hidden length parameter.&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;module m

   use, intrinsic :: iso_c_binding, only : c_size_t
   use, intrinsic :: iso_fortran_env, only : output_unit

   implicit none

   character(len=*), parameter :: msg = "Hello World!"
   character(len=*), parameter :: fmt_gen = "(*(g0))"
   character(len=*), parameter :: fmt_hex = "(g0,z0)"

contains

   subroutine F_sub( s )
   !DIR$ATTRIBUTES REFERENCE, ALIAS:'F_sub' :: F_sub
   !DIR$ATTRIBUTES REFERENCE :: s

      character(len=*), intent(inout) :: s

      write( output_unit, fmt=fmt_gen ) "F_sub: len(s) in decimal = ", len(s, kind=c_size_t)
      write( output_unit, fmt=fmt_hex ) "       len(s) in hex     = ", len(s, kind=c_size_t)

      s = msg // char(0)

      return

   end subroutine F_sub

end module m
&lt;/PRE&gt;

&lt;PRE class="brush:cpp;"&gt;#include &amp;lt;inttypes.h&amp;gt;
#include &amp;lt;stdlib.h&amp;gt;
#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;string.h&amp;gt;

extern void F_sub(char *, size_t);

static const size_t MAXSIZE = (size_t)-1;

int main()
{

   char* s;
   size_t lens;

   printf("main: MAXSIZE in decimal = %" PRIu64 "\n", MAXSIZE);
   printf("      MAXSIZE in hex     = %" PRIx64 "\n", MAXSIZE);

   lens = (size_t)10000000000;
   printf("main: lens in decimal = %" PRIu64 "\n", lens);
   printf("      lens in hex     = %" PRIx64 "\n", lens);
   s = (char *)malloc(sizeof(char *) * lens);

   if (s == NULL) return(1);
   memset(s, ' ', lens);

   F_sub(s, lens);
   printf("main: s = %s\n", s);

   return(0);
}
&lt;/PRE&gt;

&lt;P&gt;Upon execution of the x64 target on a system with sufficient memory,&lt;/P&gt;

&lt;PRE class="brush:plain;"&gt;S:\&amp;gt;p64
main: MAXSIZE in decimal = 18446744073709551615
      MAXSIZE in hex     = ffffffffffffffff
main: lens in decimal = 10000000000
      lens in hex     = 2540be400
F_sub: len(s) in decimal = 10000000000
       len(s) in hex     = 2540BE400
main: s = Hello World!

S:\&amp;gt;&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 09 Jun 2016 22:34:00 GMT</pubDate>
    <dc:creator>FortranFan</dc:creator>
    <dc:date>2016-06-09T22:34:00Z</dc:date>
    <item>
      <title>64 bit C to FORTRAN character interface issue.</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/64-bit-C-to-FORTRAN-character-interface-issue/m-p/1089401#M123826</link>
      <description>&lt;P&gt;I have a program which has a C routine calling a FORTRAN routine with&lt;BR /&gt;
	a string argument.&lt;/P&gt;

&lt;P&gt;The C routine looks like this:&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; INTEGER str_len = 128;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; CHARACTER qc_soln_name[128];&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .&amp;nbsp; .&amp;nbsp; .&amp;nbsp; .&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; .&amp;nbsp; .&amp;nbsp; .&amp;nbsp; .&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; get_slc_status_item( &amp;amp;k_case, &amp;amp;k_soln, &amp;amp;k_converged,&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; qc_soln_name, str_len);&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .&amp;nbsp; .&amp;nbsp; .&amp;nbsp; .&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; .&amp;nbsp; .&amp;nbsp; .&amp;nbsp; .&lt;/P&gt;

&lt;P&gt;The called FORTRAN routine looks like this:&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SUBROUTINE GET_SLC_STATUS_ITEM( K_CASE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; +&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; K_SOLN&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; +&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; K_CONVERGED&amp;nbsp; ,&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; +&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; QC_SOLN_NAME )&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CHARACTER&amp;nbsp; QC_SOLN_NAME * 31&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CHARACTER&amp;nbsp; QC_END&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *&amp;nbsp; 1&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; QC_END&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = CHAR( 0 )&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; QC_SOLN_NAME = QC_END&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .&amp;nbsp; .&amp;nbsp; .&amp;nbsp; .&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; .&amp;nbsp; .&amp;nbsp; .&amp;nbsp; .&lt;/P&gt;

&lt;P&gt;&lt;BR /&gt;
	When the C is compiled 32 bit and the FORTRAN is compiled 32 bit,&lt;BR /&gt;
	there is no problem.&lt;/P&gt;

&lt;P&gt;When the C is compiled 64 bit and the FORTRAN is compiled 64 bit,&lt;BR /&gt;
	execution stops at the QC_SOLN_NAME assignment with the error message:&lt;/P&gt;

&lt;P&gt;forrtl: severe (400): fort: (19) Dummy character variable&lt;BR /&gt;
	'QC_SOLN_NAME' has length 31 which is greater then actual variable&lt;BR /&gt;
	length -3689348818177884032&lt;/P&gt;

&lt;P&gt;This is using the Intel FORTRAN 11.1.072 compiler.&lt;/P&gt;

&lt;P&gt;Any ideas what the problem is and how to fix it?&lt;/P&gt;

&lt;P&gt;Thanks for any help.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jun 2016 14:43:40 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/64-bit-C-to-FORTRAN-character-interface-issue/m-p/1089401#M123826</guid>
      <dc:creator>e013805</dc:creator>
      <dc:date>2016-06-08T14:43:40Z</dc:date>
    </item>
    <item>
      <title>As your version of ifort has</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/64-bit-C-to-FORTRAN-character-interface-issue/m-p/1089402#M123827</link>
      <description>&lt;P&gt;As your version of ifort has full support for f2003 iso_c_binding, you might consider adopting that so as to avoid non-portable aspects of hidden character length arguments.&amp;nbsp; It may be difficult to remember or look up which compiler versions use int64_t for hidden lengths in 64-bit mode, and when you can get away with a mis-match in little-endian mode.&lt;/P&gt;

&lt;P&gt;We'd have to guess what you may be doing with macros on the C side, but it looks like you're taking chances with inconsistent length declarations between C and Fortran, which may or may not raise run-time errors.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jun 2016 15:17:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/64-bit-C-to-FORTRAN-character-interface-issue/m-p/1089402#M123827</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2016-06-08T15:17:00Z</dc:date>
    </item>
    <item>
      <title>Sadly, I don't think this is</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/64-bit-C-to-FORTRAN-character-interface-issue/m-p/1089403#M123828</link>
      <description>&lt;P&gt;Sadly,&amp;nbsp;I don't think this is a viable solution for me.&amp;nbsp; The program is HUGE, not all written by me (especially the C code about which I know little).&amp;nbsp; The people who wrote that are either gone now or retired.&lt;/P&gt;

&lt;P&gt;There are roughly 200 FORTRAN to C&amp;nbsp;interface routines that would need to be changed.&amp;nbsp; And then all of the calls to them from C, I assume a minimum of another 200.&amp;nbsp; Quite a daunting task I'm afraid.&lt;/P&gt;

&lt;P&gt;What I really do not understand is the difference between the Win32 which works fine and the x64 which falls on its face.&amp;nbsp; I feel there may be a compiler solution that would be much preferable to making many hundreds of source code changes.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jun 2016 18:28:57 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/64-bit-C-to-FORTRAN-character-interface-issue/m-p/1089403#M123828</guid>
      <dc:creator>e013805</dc:creator>
      <dc:date>2016-06-08T18:28:57Z</dc:date>
    </item>
    <item>
      <title>On x64, Intel Fortran expects</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/64-bit-C-to-FORTRAN-character-interface-issue/m-p/1089404#M123829</link>
      <description>&lt;P&gt;On x64, Intel Fortran expects 64-bit character lengths. Naive C code passes 32-bit int values for lengths. I assume your INTEGER is a macro or typedef for "int". If you want the easy fix, make this translate to size_t instead.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jun 2016 18:48:01 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/64-bit-C-to-FORTRAN-character-interface-issue/m-p/1089404#M123829</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2016-06-08T18:48:01Z</dc:date>
    </item>
    <item>
      <title>Here are some clues to what</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/64-bit-C-to-FORTRAN-character-interface-issue/m-p/1089405#M123830</link>
      <description>&lt;P&gt;Here are some clues to what may be happening (you did not provide a complete example, so it is not possible to be more specific).&lt;/P&gt;

&lt;P&gt;The string length is expected to be passed as a hidden argument to the Fortran subroutine, at the end of the other arguments. That length is a 4-byte integer in the 32-bit case, 8-bytes in the 64-bit case. If you specify the type of the hidden length argument as &lt;STRONG&gt;size_t&lt;/STRONG&gt;, you can cover both cases. If you pass, in error, a 4-byte length when an 8-byte length expected, errors will occur. The number in the error,&amp;nbsp;-3689348818177884032, expressed in hexadecimal, can be revealing: it is a paste up of a 4-byte length plus 4-bytes in the adjacent memory locations. In other words, 4 bytes were passed and 8 bytes are being extracted.&lt;/P&gt;

&lt;P&gt;The following is just for illustration.&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;subroutine get_slc_status_item(k_case,k_soln,k_converged,qc_soln_name)
implicit none
integer k_case,k_soln,k_converged
character(len=*) qc_soln_name
!
k_case=len(qc_soln_name)
k_soln=2001
k_converged=0
qc_soln_name='aaabbbcccdddxyzptlk'C
return
end subroutine
&lt;/PRE&gt;

&lt;P&gt;The C-program to call the above subroutine:&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;#include &amp;lt;stdio.h&amp;gt;
extern void GET_SLC_STATUS_ITEM(int *,int *,int *,char *,size_t);

main(){
int k_case,k_soln,k_converged;
char qc_soln_name[128];

GET_SLC_STATUS_ITEM(&amp;amp;k_case,&amp;amp;k_soln,&amp;amp;k_converged,qc_soln_name,(size_t)128);
printf("%d\n",k_case);
puts(qc_soln_name);
}
&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jun 2016 19:12:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/64-bit-C-to-FORTRAN-character-interface-issue/m-p/1089405#M123830</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2016-06-08T19:12:00Z</dc:date>
    </item>
    <item>
      <title>elsewhere in my program I</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/64-bit-C-to-FORTRAN-character-interface-issue/m-p/1089406#M123831</link>
      <description>&lt;P&gt;elsewhere in my program I discovered a C routine like this:&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; int&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; str_len = 32 ;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; char&amp;nbsp;&amp;nbsp;&amp;nbsp; qc_case_name[32];&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; int&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; k_error_code;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .&amp;nbsp; .&amp;nbsp; .&amp;nbsp; .&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; .&amp;nbsp; .&amp;nbsp; .&amp;nbsp; .&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; .&amp;nbsp; .&amp;nbsp; .&amp;nbsp; .&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; get_case_name ( &amp;amp;ktr, &amp;amp;k_case, qc_case_name, str_len );&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .&amp;nbsp; .&amp;nbsp; .&amp;nbsp; .&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; .&amp;nbsp; .&amp;nbsp; .&amp;nbsp; .&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; .&amp;nbsp; .&amp;nbsp; .&amp;nbsp; .&lt;/P&gt;

&lt;P&gt;The called FORTRAN routine looks like this:&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SUBROUTINE GET_CASE_NAME( KTR&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; +&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; K_CASE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; +&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; QC_CASE_NAME )&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CHARACTER&amp;nbsp; QC_CASE_NAME * 32&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CHARACTER&amp;nbsp; QC_END&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *&amp;nbsp; 1&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; QC_END = CHAR( 0 )&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .&amp;nbsp; .&amp;nbsp; .&amp;nbsp; .&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; .&amp;nbsp; .&amp;nbsp; .&amp;nbsp; .&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; .&amp;nbsp; .&amp;nbsp; .&amp;nbsp; .&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; QC_CASE_NAME = QC_END&lt;/P&gt;

&lt;P&gt;and this x64 code executes just fine and is essentially the same as&lt;BR /&gt;
	the earlier example that does not work, except for the mismatch in string lengths.&lt;/P&gt;

&lt;P&gt;You are correct that INTEGER is defined like this:&lt;/P&gt;

&lt;P&gt;typedef&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INTEGER;&lt;/P&gt;

&lt;P&gt;So you propose that I change its definition to this:&lt;/P&gt;

&lt;P&gt;&lt;BR /&gt;
	typedef&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; size_t&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INTEGER;&lt;/P&gt;

&lt;P&gt;And that will work??&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;typedef&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; size_t&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INTEGER;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jun 2016 19:30:27 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/64-bit-C-to-FORTRAN-character-interface-issue/m-p/1089406#M123831</guid>
      <dc:creator>e013805</dc:creator>
      <dc:date>2016-06-08T19:30:27Z</dc:date>
    </item>
    <item>
      <title>And that "fix" would work in</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/64-bit-C-to-FORTRAN-character-interface-issue/m-p/1089407#M123832</link>
      <description>&lt;P&gt;And that "fix" would work in both 32 bit and 64 bit modes?&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jun 2016 19:31:29 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/64-bit-C-to-FORTRAN-character-interface-issue/m-p/1089407#M123832</guid>
      <dc:creator>e013805</dc:creator>
      <dc:date>2016-06-08T19:31:29Z</dc:date>
    </item>
    <item>
      <title>The example code that I</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/64-bit-C-to-FORTRAN-character-interface-issue/m-p/1089408#M123833</link>
      <description>&lt;P&gt;The example code that I displayed in #5 works in both 32 and 64 bits, when I used the Parallel Studio compilers. If you use other compilers, the C compiler's notion of size_t must agree with the string-length argument of the Fortran compiler. The Fortran standard cannot force the C compiler to work with it, but you can use the test code of #5 to ascertain for yourself.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jun 2016 19:37:15 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/64-bit-C-to-FORTRAN-character-interface-issue/m-p/1089408#M123833</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2016-06-08T19:37:15Z</dc:date>
    </item>
    <item>
      <title>Quote:e013805 wrote:</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/64-bit-C-to-FORTRAN-character-interface-issue/m-p/1089409#M123834</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;e013805 wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;..&amp;nbsp;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;So you propose that I change its definition to this:&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;typedef&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; size_t&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INTEGER;&lt;/P&gt;

&lt;P&gt;And that will work??&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;You should check your C code for all the places the macro INTEGER is used; it's possibly used where a C int is expected in which case the above change can cause issues.&lt;/P&gt;

&lt;P&gt;You may want to follow mecej4's example is Message #5 and look at the function prototype for Fortran procedures on the C side and change the type of the "hidden" length (i.e., the last parameter in that message) to size_t and use a cast of (size_t) as shown in the example.&lt;/P&gt;

&lt;P&gt;Your latest post suggests you have an additional Fortran function with a different string length and it's possible you have other such functions; in that case you may want to make use of the enumerator facility in C to define all the string lengths in one place and use them consistently everywhere in your C code as 'good coding practice' to minimize errors.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jun 2016 21:51:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/64-bit-C-to-FORTRAN-character-interface-issue/m-p/1089409#M123834</guid>
      <dc:creator>FortranFan</dc:creator>
      <dc:date>2016-06-08T21:51:00Z</dc:date>
    </item>
    <item>
      <title>Steve,</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/64-bit-C-to-FORTRAN-character-interface-issue/m-p/1089410#M123835</link>
      <description>&lt;P&gt;Steve,&lt;/P&gt;

&lt;P&gt;You said that x64 Intel Fortran is expecting 64 bit character lengths.&amp;nbsp; My Fortran is compiled with the Default Integer KIND of 4 and the Default Real KIND of 8,&amp;nbsp; The C compiler apparently has no switch for changing default integer and real sizes.&amp;nbsp; The C prototypes for my Fortran subroutines look like this:&lt;/P&gt;

&lt;P&gt;void get_slc_status_item( INTEGER&amp;nbsp;&amp;nbsp; *K_CASE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INTEGER&amp;nbsp;&amp;nbsp; *K_SOLN&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;INTEGER&amp;nbsp;&amp;nbsp; *K_CONVERGED&amp;nbsp; ,&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CHARACTER *QC_SOLN_NAME ,&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;INTEGER&amp;nbsp;&amp;nbsp;&amp;nbsp; KC_SOLN_NAME);&lt;/P&gt;

&lt;P&gt;They all use the "INTEGER" macro which is defined as just "int", which is 4 bytes.&amp;nbsp; Apparently when my Fortran is compiled Win32, the hidden arguments are 4 bytes and when my Fortran is compiled x64 the hidden arguments are 8 bytes,.but the C is still sending 4 byte integers.&amp;nbsp; With all of the optional compilation inputs for Intel Fortran, is there not one which allows me to change the x64 hidden arguments back to 4 bytes??&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Not being much of a C programmer I am loathe to jump in to the C code (written by others than myself who are no longer around)&amp;nbsp;and making massive changes to it.&lt;/P&gt;

&lt;P&gt;Or is it possible to just get rid of the hidden argument on the C side and have Fortran look for the null terminator?&amp;nbsp; A less desirable solution from my perspective.&lt;BR /&gt;
	&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jun 2016 15:52:32 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/64-bit-C-to-FORTRAN-character-interface-issue/m-p/1089410#M123835</guid>
      <dc:creator>e013805</dc:creator>
      <dc:date>2016-06-09T15:52:32Z</dc:date>
    </item>
    <item>
      <title>Default integer has no effect</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/64-bit-C-to-FORTRAN-character-interface-issue/m-p/1089411#M123836</link>
      <description>&lt;P&gt;Default integer has no effect on character lengths. Note that the mechanism by which a particular Fortran compiler passes character values is implementation and platform-dependent.&lt;/P&gt;

&lt;P&gt;You can tell Fortran to not expect a length. You can't have it automatically look for nul-termination. The F2003 standard approach is to declare the Fortran routine with BIND(C) and have the dummy argument to be an array of single characters. When calling from Fortran to C this is pretty simple (since Fortran allows a character value of any length to be passed to a character array with BIND(C), but the C to Fortran direction is more of a pain.&lt;/P&gt;

&lt;P&gt;Fortran 2015 provides the "C descriptor" that allows a more natural interface for character values, but it is then some work on the C side to put the length into the descriptor. There's still no nul-termination support in the standard.&lt;/P&gt;

&lt;P&gt;My recommendation is to use the C interoperability features in the standard and not rely on implementation-dependent methods.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jun 2016 15:59:19 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/64-bit-C-to-FORTRAN-character-interface-issue/m-p/1089411#M123836</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2016-06-09T15:59:19Z</dc:date>
    </item>
    <item>
      <title>Passing character lengths</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/64-bit-C-to-FORTRAN-character-interface-issue/m-p/1089412#M123837</link>
      <description>&lt;P&gt;Passing character lengths explicitly from C is a problem and to solve it from the Fortran side you would need to change all the procedures invoked by C and also all the Fortran procedure that call them. To change it from the C side you need a macro that sets the type of the hidden LEN parameter (size_t doesn't cut it) and there doesn't seem to be a CFI_type_len in ISO_Fortran_binding.h. The following code tries to paas a hidden 64-bit length:&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;module M
&amp;nbsp;&amp;nbsp; use ISO_FORTRAN_ENV, only: INT64
&amp;nbsp;&amp;nbsp; contains
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; subroutine S(x)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; character(*) x(:)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; write(*,'(*(g0))') 'len(x) = ',len(x,kind=INT64)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end subroutine S
end module M

program P
&amp;nbsp;&amp;nbsp; use M
&amp;nbsp;&amp;nbsp; implicit none
&amp;nbsp;&amp;nbsp; integer(INT64) i
&amp;nbsp;&amp;nbsp; i = 10000000000_INT64
&amp;nbsp;&amp;nbsp; BLOCK
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; character(len=i) x(0)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call S(x)
&amp;nbsp;&amp;nbsp; END BLOCK
end program P
&lt;/PRE&gt;

&lt;P&gt;It prints out 10000000000 on ifort 64 bits but 1410065408 on ifort 32 bits or gfortran 5.3 64 bits. Steve could probably turn to his left to ask whether it works on the latest gfortran.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jun 2016 19:17:38 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/64-bit-C-to-FORTRAN-character-interface-issue/m-p/1089412#M123837</guid>
      <dc:creator>JVanB</dc:creator>
      <dc:date>2016-06-09T19:17:38Z</dc:date>
    </item>
    <item>
      <title>size_t is what we recommend</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/64-bit-C-to-FORTRAN-character-interface-issue/m-p/1089413#M123838</link>
      <description>&lt;P&gt;size_t is what we recommend for this purpose. But it is better to not rely on implementation-dependent features.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jun 2016 19:32:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/64-bit-C-to-FORTRAN-character-interface-issue/m-p/1089413#M123838</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2016-06-09T19:32:11Z</dc:date>
    </item>
    <item>
      <title>Quote:Repeat Offender wrote:</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/64-bit-C-to-FORTRAN-character-interface-issue/m-p/1089414#M123839</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;Repeat Offender wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;.. To change it from the C side you need a macro that sets the type of the hidden LEN parameter (size_t doesn't cut it) and ..&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;The above comment does not make sense. &amp;nbsp;From what I understand, size_t in C is an unsigned integer of a certain minimum size to represent the size of objects. &amp;nbsp;And Microsoft documentation indicates size_t is an&amp;nbsp;unsigned __int64 or unsigned integer, depending on the target platform. &amp;nbsp;So I'm not sure why size_t won't "cut it" - it seems the most natural, standard way to represent the hidden length parameter.&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;module m

   use, intrinsic :: iso_c_binding, only : c_size_t
   use, intrinsic :: iso_fortran_env, only : output_unit

   implicit none

   character(len=*), parameter :: msg = "Hello World!"
   character(len=*), parameter :: fmt_gen = "(*(g0))"
   character(len=*), parameter :: fmt_hex = "(g0,z0)"

contains

   subroutine F_sub( s )
   !DIR$ATTRIBUTES REFERENCE, ALIAS:'F_sub' :: F_sub
   !DIR$ATTRIBUTES REFERENCE :: s

      character(len=*), intent(inout) :: s

      write( output_unit, fmt=fmt_gen ) "F_sub: len(s) in decimal = ", len(s, kind=c_size_t)
      write( output_unit, fmt=fmt_hex ) "       len(s) in hex     = ", len(s, kind=c_size_t)

      s = msg // char(0)

      return

   end subroutine F_sub

end module m
&lt;/PRE&gt;

&lt;PRE class="brush:cpp;"&gt;#include &amp;lt;inttypes.h&amp;gt;
#include &amp;lt;stdlib.h&amp;gt;
#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;string.h&amp;gt;

extern void F_sub(char *, size_t);

static const size_t MAXSIZE = (size_t)-1;

int main()
{

   char* s;
   size_t lens;

   printf("main: MAXSIZE in decimal = %" PRIu64 "\n", MAXSIZE);
   printf("      MAXSIZE in hex     = %" PRIx64 "\n", MAXSIZE);

   lens = (size_t)10000000000;
   printf("main: lens in decimal = %" PRIu64 "\n", lens);
   printf("      lens in hex     = %" PRIx64 "\n", lens);
   s = (char *)malloc(sizeof(char *) * lens);

   if (s == NULL) return(1);
   memset(s, ' ', lens);

   F_sub(s, lens);
   printf("main: s = %s\n", s);

   return(0);
}
&lt;/PRE&gt;

&lt;P&gt;Upon execution of the x64 target on a system with sufficient memory,&lt;/P&gt;

&lt;PRE class="brush:plain;"&gt;S:\&amp;gt;p64
main: MAXSIZE in decimal = 18446744073709551615
      MAXSIZE in hex     = ffffffffffffffff
main: lens in decimal = 10000000000
      lens in hex     = 2540be400
F_sub: len(s) in decimal = 10000000000
       len(s) in hex     = 2540BE400
main: s = Hello World!

S:\&amp;gt;&lt;/PRE&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jun 2016 22:34:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/64-bit-C-to-FORTRAN-character-interface-issue/m-p/1089414#M123839</guid>
      <dc:creator>FortranFan</dc:creator>
      <dc:date>2016-06-09T22:34:00Z</dc:date>
    </item>
    <item>
      <title>My guess is that R/O's point</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/64-bit-C-to-FORTRAN-character-interface-issue/m-p/1089415#M123840</link>
      <description>&lt;P&gt;My guess is that R/O's point is that although Intel's implementation may have chosen &lt;STRONG&gt;size_t&amp;nbsp;&lt;/STRONG&gt;as the type for Fortran string length parameters, other compilers may use a different type (Gfortran for example, as he mentions).&lt;/P&gt;

&lt;P&gt;I doubt if the C standard committee has any plans to define Fortran compatibility for C, one item of that being, let us say, "size_fsl" for Fortran string length for a companion Fortran processor! Perhaps a header file could be provided with a typedef for Fortran string length? What do C programmers think about all this?&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jun 2016 23:50:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/64-bit-C-to-FORTRAN-character-interface-issue/m-p/1089415#M123840</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2016-06-09T23:50:50Z</dc:date>
    </item>
    <item>
      <title>Quote:mecej4 wrote:</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/64-bit-C-to-FORTRAN-character-interface-issue/m-p/1089416#M123841</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;mecej4 wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;My guess is that R/O's point is that although Intel's implementation may have chosen &lt;STRONG&gt;size_t&amp;nbsp;&lt;/STRONG&gt;as the type for Fortran string length parameters, other compilers may use a different type (Gfortran for example, as he mentions).&lt;/P&gt;

&lt;P&gt;I doubt if the C standard committee has any plans to define Fortran compatibility for C, one item of that being, let us say, "size_fsl" for Fortran string length for a companion Fortran processor! Perhaps a header file could be provided with a typedef for Fortran string length? What do C programmers think about all this?&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Well, Steve et al. have already advised OP to use standard features for interoperability, especially if portability is desired.&lt;/P&gt;

&lt;P&gt;The 'hidden' character length issue only appears relevant to OP because of the specific use with Intel Fortran toward 32-bit and 64-bit targets, so not sure how compatibility across different compilers comes into play. &amp;nbsp;Oh.. whatever..&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2016 00:26:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/64-bit-C-to-FORTRAN-character-interface-issue/m-p/1089416#M123841</guid>
      <dc:creator>FortranFan</dc:creator>
      <dc:date>2016-06-10T00:26:36Z</dc:date>
    </item>
    <item>
      <title>Steve, Not sure I am</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/64-bit-C-to-FORTRAN-character-interface-issue/m-p/1089417#M123842</link>
      <description>&lt;P&gt;Steve, Not sure I am understanding.&amp;nbsp; I changed my C function prototype to this:&lt;/P&gt;

&lt;P&gt;void get_slc_status_item( INTEGER&amp;nbsp;&amp;nbsp; *K_CASE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INTEGER&amp;nbsp;&amp;nbsp; *K_SOLN&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;INTEGER&amp;nbsp;&amp;nbsp; *K_CONVERGED&amp;nbsp; ,&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CHARACTER *QC_SOLN_NAME ,&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;long&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; KC_SOLN_NAME);&lt;/P&gt;

&lt;P&gt;and now my C routine looks like this:&lt;/P&gt;

&lt;P&gt;a string argument.&lt;/P&gt;

&lt;P&gt;The C routine looks like this:&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;long&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;str_len = 128;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; CHARACTER qc_soln_name[128];&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .&amp;nbsp; .&amp;nbsp; .&amp;nbsp; .&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp; .&amp;nbsp; .&amp;nbsp; .&amp;nbsp; .&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; get_slc_status_item( &amp;amp;k_case, &amp;amp;k_soln, &amp;amp;k_converged,&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; qc_soln_name, str_len);&lt;/P&gt;

&lt;P&gt;And still have the same problem.&amp;nbsp; (I'm not really all that concerned about portability at this time)&amp;nbsp; Based on your comment that the Intel Fortran is expecting 64 bit character lengths, I rather expected this to work, shouldn't it have worked??&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jun 2016 17:48:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/64-bit-C-to-FORTRAN-character-interface-issue/m-p/1089417#M123842</guid>
      <dc:creator>e013805</dc:creator>
      <dc:date>2016-06-13T17:48:48Z</dc:date>
    </item>
    <item>
      <title>Making the prototype long</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/64-bit-C-to-FORTRAN-character-interface-issue/m-p/1089418#M123843</link>
      <description>&lt;P&gt;Making the prototype long long and the specification for str_len long long seems to make the Fortran happy, or at least happier.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jun 2016 18:04:27 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/64-bit-C-to-FORTRAN-character-interface-issue/m-p/1089418#M123843</guid>
      <dc:creator>e013805</dc:creator>
      <dc:date>2016-06-13T18:04:27Z</dc:date>
    </item>
    <item>
      <title>long is still 32-bit. Why</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/64-bit-C-to-FORTRAN-character-interface-issue/m-p/1089419#M123844</link>
      <description>&lt;P&gt;long is still 32-bit. Why didn't you use size_t as I recommended? long long won't work on 32-bit - this is exactly what size_t is for.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Of course, I also recommended using the standard's features for C interoperability rather than depending on implementation-dependent hidden arguments.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jun 2016 18:13:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/64-bit-C-to-FORTRAN-character-interface-issue/m-p/1089419#M123844</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2016-06-13T18:13:00Z</dc:date>
    </item>
    <item>
      <title>Using long long was just an</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/64-bit-C-to-FORTRAN-character-interface-issue/m-p/1089420#M123845</link>
      <description>&lt;P&gt;Using long long was just an experiment.&amp;nbsp; Apparently FortranFan was correct in his assumption that INTEGER might be used in a location where a C int was required, as when I tried doing this:&lt;/P&gt;

&lt;P&gt;typedef&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; size_t&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; INTEGER;&lt;/P&gt;

&lt;P&gt;the program dies in the debugger with an error whose source is not clear to me.&amp;nbsp; It might be this call:&lt;/P&gt;

&lt;P&gt;&lt;FONT size="2"&gt;k_x_def_vec = calloc(k_x_num_ctr_pts, &lt;/FONT&gt;&lt;FONT color="#0000ff" size="2"&gt;&lt;FONT color="#0000ff" size="2"&gt;sizeof&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size="2"&gt;(INTEGER));&lt;/FONT&gt;&lt;/P&gt;

&lt;P&gt;&lt;FONT size="2"&gt;where INTEGER is now size_t&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jun 2016 20:54:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/64-bit-C-to-FORTRAN-character-interface-issue/m-p/1089420#M123845</guid>
      <dc:creator>e013805</dc:creator>
      <dc:date>2016-06-13T20:54:00Z</dc:date>
    </item>
  </channel>
</rss>

