<?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 Program Passes Character String Length Incorrectly to Pointer Function in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Program-Passes-Character-String-Length-Incorrectly-to-Pointer/m-p/1370396#M160699</link>
    <description>&lt;P&gt;On rare occasions my program passes a character string length incorrectly to a pointer function.&amp;nbsp; Instead of passing the correct length of the string, the length of the string is an address of some kind of data.&amp;nbsp; E.g., the actual argument is a character string of length 5.&amp;nbsp; However, inside of the pointer function, the length is 842666016, which appears to be some kind of machine address.&amp;nbsp; If I run the program several different times, this error appear at the same place in the program but the length inside of the function is different each time the program is run.&lt;/P&gt;
&lt;P&gt;I am getting this error while doing consulting work for Bank of New York Mellon (BNYM).&amp;nbsp; BNYM is using Intel Fortran 19.1.3 under Linux.&lt;/P&gt;
&lt;P&gt;Has this error been corrected in a subsequent version of Intel Fortran and, if so, which version?&lt;/P&gt;</description>
    <pubDate>Sun, 20 Mar 2022 22:57:22 GMT</pubDate>
    <dc:creator>Craig_T_Dedo</dc:creator>
    <dc:date>2022-03-20T22:57:22Z</dc:date>
    <item>
      <title>Program Passes Character String Length Incorrectly to Pointer Function</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Program-Passes-Character-String-Length-Incorrectly-to-Pointer/m-p/1370396#M160699</link>
      <description>&lt;P&gt;On rare occasions my program passes a character string length incorrectly to a pointer function.&amp;nbsp; Instead of passing the correct length of the string, the length of the string is an address of some kind of data.&amp;nbsp; E.g., the actual argument is a character string of length 5.&amp;nbsp; However, inside of the pointer function, the length is 842666016, which appears to be some kind of machine address.&amp;nbsp; If I run the program several different times, this error appear at the same place in the program but the length inside of the function is different each time the program is run.&lt;/P&gt;
&lt;P&gt;I am getting this error while doing consulting work for Bank of New York Mellon (BNYM).&amp;nbsp; BNYM is using Intel Fortran 19.1.3 under Linux.&lt;/P&gt;
&lt;P&gt;Has this error been corrected in a subsequent version of Intel Fortran and, if so, which version?&lt;/P&gt;</description>
      <pubDate>Sun, 20 Mar 2022 22:57:22 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Program-Passes-Character-String-Length-Incorrectly-to-Pointer/m-p/1370396#M160699</guid>
      <dc:creator>Craig_T_Dedo</dc:creator>
      <dc:date>2022-03-20T22:57:22Z</dc:date>
    </item>
    <item>
      <title>Re: Program Passes Character String Length Incorrectly to Pointer Function</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Program-Passes-Character-String-Length-Incorrectly-to-Pointer/m-p/1370397#M160700</link>
      <description>&lt;P&gt;We'll need to see a test program that shows the problem, Craig. I have not heard of such a compiler bug. More likely it's a coding error in your application that is picking up an uninitialized stack value.&lt;/P&gt;</description>
      <pubDate>Sun, 20 Mar 2022 23:14:01 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Program-Passes-Character-String-Length-Incorrectly-to-Pointer/m-p/1370397#M160700</guid>
      <dc:creator>Steve_Lionel</dc:creator>
      <dc:date>2022-03-20T23:14:01Z</dc:date>
    </item>
    <item>
      <title>Re: Program Passes Character String Length Incorrectly to Pointer Function</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Program-Passes-Character-String-Length-Incorrectly-to-Pointer/m-p/1370614#M160709</link>
      <description>&lt;P&gt;Craig, I do not understand what you mean by the term "pointer function". Please clarify.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Mar 2022 15:10:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Program-Passes-Character-String-Length-Incorrectly-to-Pointer/m-p/1370614#M160709</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2022-03-21T15:10:23Z</dc:date>
    </item>
    <item>
      <title>Re: Program Passes Character String Length Incorrectly to Pointer Function</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Program-Passes-Character-String-Length-Incorrectly-to-Pointer/m-p/1370620#M160710</link>
      <description>&lt;P&gt;I forgot to mention that the OS is Red Hat Enterprise Linux Version 7.9.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Mar 2022 15:23:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Program-Passes-Character-String-Length-Incorrectly-to-Pointer/m-p/1370620#M160710</guid>
      <dc:creator>Craig_T_Dedo</dc:creator>
      <dc:date>2022-03-21T15:23:30Z</dc:date>
    </item>
    <item>
      <title>Re: Program Passes Character String Length Incorrectly to Pointer Function</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Program-Passes-Character-String-Length-Incorrectly-to-Pointer/m-p/1370623#M160711</link>
      <description>&lt;P&gt;Craig, the latest compilers don't need a license.&amp;nbsp; I would advise you set up another system or even the same system with the latest 2022.x compilers.&amp;nbsp; &lt;A href="https://community.intel.com/t5/Intel-Fortran-Compiler/The-Easy-and-Fast-Way-to-Install-JUST-Fortran-with-Intel-oneAPI/m-p/1360571#M160118" target="_self"&gt;Information is HERE&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But I agree with Steve that it's probably not a compiler bug.&amp;nbsp; Our ABI for passing strings has not changed for years and years.&amp;nbsp; Pretty straightforward and for sure if there was a bug we'd have heard about it long before now.&amp;nbsp; More than likely you are seeing stack corruption, especially if it's a mixed language application.&amp;nbsp; &amp;nbsp;You may consider the &lt;A href="https://www.intel.com/content/www/us/en/develop/documentation/fortran-compiler-oneapi-dev-guide-and-reference/top/compiler-reference/compiler-options/compiler-option-details/floating-point-options/fp-stack-check-qfp-stack-check.html" target="_blank" rel="noopener"&gt;fp-stack-check option&lt;/A&gt; which MAY catch something.&amp;nbsp; But it cannot catch all stack corruption issues.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Mar 2022 15:26:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Program-Passes-Character-String-Length-Incorrectly-to-Pointer/m-p/1370623#M160711</guid>
      <dc:creator>Ron_Green</dc:creator>
      <dc:date>2022-03-21T15:26:18Z</dc:date>
    </item>
    <item>
      <title>Re: Program Passes Character String Length Incorrectly to Pointer Function</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Program-Passes-Character-String-Length-Incorrectly-to-Pointer/m-p/1370626#M160712</link>
      <description>&lt;P&gt;It's a function that returns a pointer to a node in a binary tree.&amp;nbsp; For reasons of following mandatory rules of security and confidentiality I can't post the exact source code.&amp;nbsp; Here is an example that illustrates the situation without revealing the exact source code.&lt;/P&gt;
&lt;P&gt;&lt;FONT face="lucida sans unicode,lucida sans"&gt;Type (Binary_Tree_Node_T) :: Item&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="lucida sans unicode,lucida sans"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; . . .&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="lucida sans unicode,lucida sans"&gt;Item =&amp;gt; Binary_Tree_Function ( Binary_Tree_Head, Fixed_Length_Char_String )&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Fixed_Length_Char_String has the correct length on the caller side.&amp;nbsp; It has a different length that resembles an address inside the function, i.e., a value in the hundreds of millions or billions.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Mar 2022 15:33:29 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Program-Passes-Character-String-Length-Incorrectly-to-Pointer/m-p/1370626#M160712</guid>
      <dc:creator>Craig_T_Dedo</dc:creator>
      <dc:date>2022-03-21T15:33:29Z</dc:date>
    </item>
    <item>
      <title>Re: Program Passes Character String Length Incorrectly to Pointer Function</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Program-Passes-Character-String-Length-Incorrectly-to-Pointer/m-p/1370627#M160713</link>
      <description>&lt;P&gt;Is Binary_Tree_Function a Fortran function?&lt;/P&gt;
&lt;P&gt;Is the interface defined with an INTERFACE or is it defined as a module procedure?&lt;/P&gt;
&lt;P&gt;Is this a recursive function, implementing a recursive tree search algorithm?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;have you unlimited stack before running with&amp;nbsp;&lt;/P&gt;
&lt;P&gt;'ulimit -s unlimited' ; a.out (0r whatever command line you use to run the code)&lt;/P&gt;</description>
      <pubDate>Mon, 21 Mar 2022 15:40:53 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Program-Passes-Character-String-Length-Incorrectly-to-Pointer/m-p/1370627#M160713</guid>
      <dc:creator>Ron_Green</dc:creator>
      <dc:date>2022-03-21T15:40:53Z</dc:date>
    </item>
    <item>
      <title>Re: Program Passes Character String Length Incorrectly to Pointer Function</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Program-Passes-Character-String-Length-Incorrectly-to-Pointer/m-p/1370630#M160714</link>
      <description>&lt;P&gt;&amp;nbsp;I wrote a small program to illustrate such pointer functions:&lt;/P&gt;
&lt;LI-CODE lang="fortran"&gt;! chk_string_pointer.f90
!     Check pointer functions that return strings
!
module string_pointers
    implicit none

    character(len=20), dimension(10), target :: array_strings
contains
function pointer_to_string( i )
     integer, intent(in) :: i

     character(len=:), pointer :: pointer_to_string

     pointer_to_string =&amp;gt; array_strings(i)

     write(*,*) 'Check: ', len(pointer_to_string)
end function pointer_to_string
end module string_pointers

program chk_string_pointer
    use string_pointers
    implicit none


    write(*,*) 'Checking lengths ...'

    pointer_to_string(1) = '1234567890'
    pointer_to_string(2) = '12345678901234567890'

    write(*,*) len(pointer_to_string(3)), ' - 10 expected'

    array_strings(1) = array_strings(1)(1:4) // 'ABC'
    write(*,*) pointer_to_string(1)
end program chk_string_pointer
&lt;/LI-CODE&gt;
&lt;P&gt;The results are, well, odd:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;gfortran version 10.2.0 (equation.com) produces a program, but that gets stuck at line 28 or 30.&lt;/LI&gt;
&lt;LI&gt;gfortran version 11.2.0 (Cygwin) gets stuck itself (or at least my patience ran out).&lt;/LI&gt;
&lt;LI&gt;Intel Fortran version 2021.4.0 produces error messages that I cannot link to the source code:&lt;/LI&gt;
&lt;/UL&gt;
&lt;LI-CODE lang="none"&gt;ifort chk_string_pointer.f90
Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on Intel(R) 64, Version 2021.4.0 Build 20210910_000000
Copyright (C) 1985-2021 Intel Corporation.  All rights reserved.

chk_string_pointer.f90(27): error #6423: This name has already been used as an external function name.   [POINTER_TO_STRING]
    pointer_to_string(1) = '1234567890'
----^
chk_string_pointer.f90(27): error #6515: This function, which is specified as the left side of an assignment statement, is invalid.   [POINTER_TO_STRING]
    pointer_to_string(1) = '1234567890'
----^
chk_string_pointer.f90(28): error #6423: This name has already been used as an external function name.   [POINTER_TO_STRING]
    pointer_to_string(2) = '12345678901234567890'
----^
chk_string_pointer.f90(28): error #6515: This function, which is specified as the left side of an assignment statement, is invalid.   [POINTER_TO_STRING]
    pointer_to_string(2) = '12345678901234567890'
----^
compilation aborted for chk_string_pointer.f90 (code 1)
&lt;/LI-CODE&gt;
&lt;P&gt;Well, so far my demonstration ;).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Mar 2022 15:45:05 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Program-Passes-Character-String-Length-Incorrectly-to-Pointer/m-p/1370630#M160714</guid>
      <dc:creator>Arjen_Markus</dc:creator>
      <dc:date>2022-03-21T15:45:05Z</dc:date>
    </item>
    <item>
      <title>Re: Program Passes Character String Length Incorrectly to Pointer Function</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Program-Passes-Character-String-Length-Incorrectly-to-Pointer/m-p/1370631#M160715</link>
      <description>&lt;P&gt;Here are the answers to your questions.&lt;/P&gt;
&lt;P&gt;Yes, Binary_Tree_Function is a Fortran function.&lt;/P&gt;
&lt;P&gt;The function is a module procedure so the interface is explicit.&lt;/P&gt;
&lt;P&gt;Yes, it is a recursive function implementing a recursive tree search algorithm.&lt;/P&gt;
&lt;P&gt;No, I have not implemented unlimited stack using a command similar to what you recommended.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Mar 2022 15:55:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Program-Passes-Character-String-Length-Incorrectly-to-Pointer/m-p/1370631#M160715</guid>
      <dc:creator>Craig_T_Dedo</dc:creator>
      <dc:date>2022-03-21T15:55:07Z</dc:date>
    </item>
    <item>
      <title>Re: Program Passes Character String Length Incorrectly to Pointer Function</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Program-Passes-Character-String-Length-Incorrectly-to-Pointer/m-p/1370637#M160716</link>
      <description>&lt;P class="sub_section_element_selectors"&gt;&amp;nbsp;I wrote a small program to illustrate such pointer functions:&lt;/P&gt;
&lt;PRE class="lia-code-sample line-numbers language-fortran"&gt;&lt;CODE&gt;! chk_string_pointer.f90
!     Check pointer functions that return strings
!
module string_pointers
    implicit none

    character(len=20), dimension(10), target :: array_strings
contains
function pointer_to_string( i )
     integer, intent(in) :: i

     character(len=:), pointer :: pointer_to_string

     pointer_to_string =&amp;gt; array_strings(i)

     write(*,*) 'Check: ', len(pointer_to_string)
end function pointer_to_string
end module string_pointers

program chk_string_pointer
    use string_pointers
    implicit none


    write(*,*) 'Checking lengths ...'

    pointer_to_string(1) = '1234567890'
    pointer_to_string(2) = '12345678901234567890'

    write(*,*) len(pointer_to_string(3)), ' - 10 expected'

    array_strings(1) = array_strings(1)(1:4) // 'ABC'
    write(*,*) pointer_to_string(1)
end program chk_string_pointer
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P class="sub_section_element_selectors"&gt;The results are, well, odd:&lt;/P&gt;
&lt;UL&gt;
&lt;LI class="sub_section_element_selectors"&gt;gfortran version 10.2.0 (equation.com) produces a program, but that gets stuck at line 28 or 30.&lt;/LI&gt;
&lt;LI class="sub_section_element_selectors"&gt;gfortran version 11.2.0 (Cygwin) gets stuck itself (or at least my patience ran out).&lt;/LI&gt;
&lt;LI class="sub_section_element_selectors"&gt;Intel Fortran version 2021.4.0 produces error messages that I cannot link to the source code:&lt;/LI&gt;
&lt;/UL&gt;
&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;ifort chk_string_pointer.f90
Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on Intel(R) 64, Version 2021.4.0 Build 20210910_000000
Copyright (C) 1985-2021 Intel Corporation.  All rights reserved.

chk_string_pointer.f90(27): error #6423: This name has already been used as an external function name.   [POINTER_TO_STRING]
    pointer_to_string(1) = '1234567890'
----^
chk_string_pointer.f90(27): error #6515: This function, which is specified as the left side of an assignment statement, is invalid.   [POINTER_TO_STRING]
    pointer_to_string(1) = '1234567890'
----^
chk_string_pointer.f90(28): error #6423: This name has already been used as an external function name.   [POINTER_TO_STRING]
    pointer_to_string(2) = '12345678901234567890'
----^
chk_string_pointer.f90(28): error #6515: This function, which is specified as the left side of an assignment statement, is invalid.   [POINTER_TO_STRING]
    pointer_to_string(2) = '12345678901234567890'
----^
compilation aborted for chk_string_pointer.f90 (code 1)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 21 Mar 2022 16:12:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Program-Passes-Character-String-Length-Incorrectly-to-Pointer/m-p/1370637#M160716</guid>
      <dc:creator>Arjen_Markus</dc:creator>
      <dc:date>2022-03-21T16:12:23Z</dc:date>
    </item>
    <item>
      <title>Re: Program Passes Character String Length Incorrectly to Pointer Function</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Program-Passes-Character-String-Length-Incorrectly-to-Pointer/m-p/1370638#M160717</link>
      <description>&lt;P class="sub_section_element_selectors"&gt;&amp;nbsp;(I have tried posting this answer several times and it did not show up, so hopefully it does now)&lt;/P&gt;
&lt;P class="sub_section_element_selectors"&gt;I wrote a small program to illustrate such pointer functions:&lt;/P&gt;
&lt;PRE class="lia-code-sample line-numbers language-fortran"&gt;&lt;CODE&gt;! chk_string_pointer.f90
!     Check pointer functions that return strings
!
module string_pointers
    implicit none

    character(len=20), dimension(10), target :: array_strings
contains
function pointer_to_string( i )
     integer, intent(in) :: i

     character(len=:), pointer :: pointer_to_string

     pointer_to_string =&amp;gt; array_strings(i)

     write(*,*) 'Check: ', len(pointer_to_string)
end function pointer_to_string
end module string_pointers

program chk_string_pointer
    use string_pointers
    implicit none


    write(*,*) 'Checking lengths ...'

    pointer_to_string(1) = '1234567890'
    pointer_to_string(2) = '12345678901234567890'

    write(*,*) len(pointer_to_string(3)), ' - 10 expected'

    array_strings(1) = array_strings(1)(1:4) // 'ABC'
    write(*,*) pointer_to_string(1)
end program chk_string_pointer
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P class="sub_section_element_selectors"&gt;The results are, well, odd:&lt;/P&gt;
&lt;UL&gt;
&lt;LI class="sub_section_element_selectors"&gt;gfortran version 10.2.0 (equation.com) produces a program, but that gets stuck at line 28 or 30.&lt;/LI&gt;
&lt;LI class="sub_section_element_selectors"&gt;gfortran version 11.2.0 (Cygwin) gets stuck itself (or at least my patience ran out).&lt;/LI&gt;
&lt;LI class="sub_section_element_selectors"&gt;Intel Fortran version 2021.4.0 produces error messages that I cannot link to the source code:&lt;/LI&gt;
&lt;/UL&gt;
&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;ifort chk_string_pointer.f90
Intel(R) Fortran Intel(R) 64 Compiler Classic for applications running on Intel(R) 64, Version 2021.4.0 Build 20210910_000000
Copyright (C) 1985-2021 Intel Corporation.  All rights reserved.

chk_string_pointer.f90(27): error #6423: This name has already been used as an external function name.   [POINTER_TO_STRING]
    pointer_to_string(1) = '1234567890'
----^
chk_string_pointer.f90(27): error #6515: This function, which is specified as the left side of an assignment statement, is invalid.   [POINTER_TO_STRING]
    pointer_to_string(1) = '1234567890'
----^
chk_string_pointer.f90(28): error #6423: This name has already been used as an external function name.   [POINTER_TO_STRING]
    pointer_to_string(2) = '12345678901234567890'
----^
chk_string_pointer.f90(28): error #6515: This function, which is specified as the left side of an assignment statement, is invalid.   [POINTER_TO_STRING]
    pointer_to_string(2) = '12345678901234567890'
----^
compilation aborted for chk_string_pointer.f90 (code 1)
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Mar 2022 16:16:38 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Program-Passes-Character-String-Length-Incorrectly-to-Pointer/m-p/1370638#M160717</guid>
      <dc:creator>Arjen_Markus</dc:creator>
      <dc:date>2022-03-21T16:16:38Z</dc:date>
    </item>
    <item>
      <title>Re: Program Passes Character String Length Incorrectly to Pointer Function</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Program-Passes-Character-String-Length-Incorrectly-to-Pointer/m-p/1370641#M160718</link>
      <description>&lt;P&gt;I left out an important detail.&amp;nbsp; The functions that search the binary tree use iteration to perform the searches, not recursion.&amp;nbsp; All of the searches are implemented using Do While loops.&amp;nbsp; Within each loop there are tests to exit the loop if found or if at an end node in the binary tree.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Mar 2022 16:25:35 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Program-Passes-Character-String-Length-Incorrectly-to-Pointer/m-p/1370641#M160718</guid>
      <dc:creator>Craig_T_Dedo</dc:creator>
      <dc:date>2022-03-21T16:25:35Z</dc:date>
    </item>
    <item>
      <title>Re: Program Passes Character String Length Incorrectly to Pointer Function</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Program-Passes-Character-String-Length-Incorrectly-to-Pointer/m-p/1370643#M160719</link>
      <description>&lt;P&gt;is the character length corrupted on the head node, or does it go bad deep in the search?&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Looks like a good debugging issue but for sure try the latest compiler first just in case there is some compiler bug in the older 19.1 compiler.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the&amp;nbsp;&lt;SPAN&gt;Binary_Tree_Node_T type has a unique ID component, say "node%id", you could put a check at the top of Binary_Tree_Function for the length of the passed string.&amp;nbsp; Psuedo code similar to&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;integer, parameter :: MAX_CHAR_LEN = 200&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;...&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;if ( (len_trim(&amp;nbsp;Fixed_Length_Char_String ) &amp;gt; MAX_CHAR_LEN) .OR. (len_trim(Fixed_Length_Char_string) &amp;lt; 0) ) then&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;write(*,*) "bad char len ", len_trim( Fixed_Length_Char_String)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;write(*,*) "Node ID", node%id&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;!... better if parent is known, do you have a parent link in the node type? )&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;write(*,*) "Parent node ID", node%parent%id&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;stop&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;end if&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Mar 2022 16:31:38 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Program-Passes-Character-String-Length-Incorrectly-to-Pointer/m-p/1370643#M160719</guid>
      <dc:creator>Ron_Green</dc:creator>
      <dc:date>2022-03-21T16:31:38Z</dc:date>
    </item>
    <item>
      <title>Re: Program Passes Character String Length Incorrectly to Pointer Function</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Program-Passes-Character-String-Length-Incorrectly-to-Pointer/m-p/1370677#M160723</link>
      <description>&lt;P&gt;Arjen, I cannot make sense of your program. On lines 27 and 28, you are treating the identifier pointer_to_string as an array and trying to assign values to the first two elements of the array. However, the definition of pointer_to_string as a function is already in scope.&amp;nbsp; Or, ... , what did I miss?&lt;/P&gt;</description>
      <pubDate>Mon, 21 Mar 2022 17:55:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Program-Passes-Character-String-Length-Incorrectly-to-Pointer/m-p/1370677#M160723</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2022-03-21T17:55:41Z</dc:date>
    </item>
    <item>
      <title>Re: Program Passes Character String Length Incorrectly to Pointer Function</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Program-Passes-Character-String-Length-Incorrectly-to-Pointer/m-p/1370740#M160728</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.intel.com/t5/user/viewprofilepage/user-id/41971"&gt;@mecej4&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;...On lines 27 and 28, you are treating the identifier pointer_to_string as an array and trying to assign values to the first two elements of the array. However, the definition of pointer_to_string as a function is already in scope.&amp;nbsp; Or, ... , what did I miss?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;F2008 introduced the ability to have a function with pointer result on the left hand side of an assignment statement.&amp;nbsp; Not that I think it is relevant to the OP's &lt;STRIKE&gt;guessing game&lt;/STRIKE&gt; problem.&lt;/P&gt;
&lt;P&gt;(Once the compiler bug that stops this compiling is fixed, Arjen should expect a length of 20, not 10, or there is a typo somewhere.)&lt;/P&gt;</description>
      <pubDate>Mon, 21 Mar 2022 20:58:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Program-Passes-Character-String-Length-Incorrectly-to-Pointer/m-p/1370740#M160728</guid>
      <dc:creator>IanH</dc:creator>
      <dc:date>2022-03-21T20:58:50Z</dc:date>
    </item>
    <item>
      <title>Re: Program Passes Character String Length Incorrectly to Pointer Function</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Program-Passes-Character-String-Length-Incorrectly-to-Pointer/m-p/1370808#M160731</link>
      <description>&lt;P&gt;Thanks, Ian; I find the feature described in section 6.5, "Pointer functions" of the paper&amp;nbsp;&lt;A href="https://wg5-fortran.org/N1801-N1850/N1828.pdf" target="_self"&gt;The New Features of Fortran 2008&lt;/A&gt;&amp;nbsp;.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Mar 2022 01:51:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Program-Passes-Character-String-Length-Incorrectly-to-Pointer/m-p/1370808#M160731</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2022-03-22T01:51:31Z</dc:date>
    </item>
  </channel>
</rss>

