<?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: error #6341 - ifx can't compile line like: if(aFunction) in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/error-6341-ifx-can-t-compile-line-like-if-aFunction/m-p/1746610#M178784</link>
    <description>&lt;P&gt;The compiler is not clairvoyant when it comes to using functions in a program. In the C programming language, this issue is gotten around by the use of header files. That way the compiler knows how to deal with a function when it encounters it. Of course, most Fortran compilers handle intrinsic functions, which are part of the language standard and are thus well defined, in the manner you are thinking of.&lt;/P&gt;</description>
    <pubDate>Sun, 03 May 2026 21:19:06 GMT</pubDate>
    <dc:creator>witwald</dc:creator>
    <dc:date>2026-05-03T21:19:06Z</dc:date>
    <item>
      <title>error #6341 - ifx can't compile line like: if(aFunction)</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/error-6341-ifx-can-t-compile-line-like-if-aFunction/m-p/1746550#M178778</link>
      <description>&lt;P&gt;Here is a demo.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;! if_aFunc.f90
!======================================================================
! Compile with: 

! ifx if_aFunc.f90
!======================================================================
! Compiling Errors:

!Intel(R) Fortran Compiler for applications running on Intel(R) 64, Version 2025.1.0 Build 20250317
!Copyright (C) 1985-2025 Intel Corporation. All rights reserved.

!if_afunc.f90(27): error #6385: The highest data type rank permitted is INTEGER(KIND=8).   [AFUNC]
!      if (aFunc(sText1)) print *,'false'
!----------^
!if_afunc.f90(27): error #6341: A logical data type is required in this context.   [AFUNC]
!      if (aFunc(sText1)) print *,'false'
!----------^
!compilation aborted for if_afunc.f90 (code 1)
!======================================================================
!source

      logical      :: iRet       
      iRet = aFunc(sText1)
      if (iRet) print *,'Work' 
      
      !Can't compile next line 
      if (aFunc(sText1)) print *,'Not Work.'
      end
!======================================================================
RECURSIVE LOGICAL FUNCTION aFunc()
      aFunc=.TRUE. 
END FUNCTION aFunc&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 02 May 2026 11:35:08 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/error-6341-ifx-can-t-compile-line-like-if-aFunction/m-p/1746550#M178778</guid>
      <dc:creator>cean</dc:creator>
      <dc:date>2026-05-02T11:35:08Z</dc:date>
    </item>
    <item>
      <title>Re: error #6341 - ifx can't compile line like: if(aFunction)</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/error-6341-ifx-can-t-compile-line-like-if-aFunction/m-p/1746557#M178779</link>
      <description>&lt;P&gt;The compiler is correct, because aFunc is implicitly REAL and not allowed as the IF expression. It's possibly also a mismatch in your real application. Try this instead:&lt;/P&gt;&lt;LI-CODE lang="fortran"&gt;      logical      :: iRet, aFunc       
      iRet = aFunc(sText1)
      if (iRet) print *,'Work' 
      
      !Can't compile next line 
      if (aFunc(sText1)) print *,'Not Work.'
      end&lt;/LI-CODE&gt;</description>
      <pubDate>Sat, 02 May 2026 15:08:29 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/error-6341-ifx-can-t-compile-line-like-if-aFunction/m-p/1746557#M178779</guid>
      <dc:creator>Steve_Lionel</dc:creator>
      <dc:date>2026-05-02T15:08:29Z</dc:date>
    </item>
    <item>
      <title>Re: error #6341 - ifx can't compile line like: if(aFunction)</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/error-6341-ifx-can-t-compile-line-like-if-aFunction/m-p/1746568#M178780</link>
      <description>&lt;P&gt;why this definition doesn't work:&amp;nbsp;&lt;SPAN&gt;RECURSIVE LOGICAL FUNCTION aFunc()&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;How to define a function to return a&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;LOGICAL value?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am trying to compile Xeffort. It has a lost of this kind of call.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 03 May 2026 02:02:22 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/error-6341-ifx-can-t-compile-line-like-if-aFunction/m-p/1746568#M178780</guid>
      <dc:creator>cean</dc:creator>
      <dc:date>2026-05-03T02:02:22Z</dc:date>
    </item>
    <item>
      <title>Re: error #6341 - ifx can't compile line like: if(aFunction)</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/error-6341-ifx-can-t-compile-line-like-if-aFunction/m-p/1746571#M178781</link>
      <description>&lt;P&gt;Here is a working example of your original code. It compiles and runs using the Intel ifx compiler (under Windows). It is necessary to ensure that the data types are explicitly declared. Using 'implicit none' will help you to ensure that this is the case.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="fortran"&gt;program prog_if_aFunc

implicit none

logical           :: aFunc, iRet
character(len=20) :: sText1

iRet = aFunc(sText1)
if (iRet) print *,'Works - iRet'

if (aFunc(sText1)) print *,'Works - aFunc'

end

!======================================================================

RECURSIVE LOGICAL FUNCTION aFunc(sText)
  implicit none
  character(len=*), intent(in) :: sText
  aFunc = .TRUE.
END FUNCTION aFunc&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Below is the output:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="none"&gt; Works - iRet
 Works - aFunc&lt;/LI-CODE&gt;</description>
      <pubDate>Sun, 03 May 2026 04:41:40 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/error-6341-ifx-can-t-compile-line-like-if-aFunction/m-p/1746571#M178781</guid>
      <dc:creator>witwald</dc:creator>
      <dc:date>2026-05-03T04:41:40Z</dc:date>
    </item>
    <item>
      <title>Re: error #6341 - ifx can't compile line like: if(aFunction)</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/error-6341-ifx-can-t-compile-line-like-if-aFunction/m-p/1746572#M178782</link>
      <description>No, you have the redeclare in the main.&lt;BR /&gt;logical :: aFunc&lt;BR /&gt;&lt;BR /&gt;I don't want to add this.</description>
      <pubDate>Sun, 03 May 2026 05:52:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/error-6341-ifx-can-t-compile-line-like-if-aFunction/m-p/1746572#M178782</guid>
      <dc:creator>cean</dc:creator>
      <dc:date>2026-05-03T05:52:31Z</dc:date>
    </item>
    <item>
      <title>Re: error #6341 - ifx can't compile line like: if(aFunction)</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/error-6341-ifx-can-t-compile-line-like-if-aFunction/m-p/1746600#M178783</link>
      <description>&lt;P&gt;The main program doesn't know the declaration of aFunc as it is a separate subprogram. Just having it in the same source file is not sufficient. Given this, you must declare it in the main program or from whichever program unit you call it from. You can avoid this by putting aFunc in a module and USEing the module in the main program,. or by making aFunc an internal subprogram of the main, after a CONTAINS.&lt;/P&gt;&lt;P&gt;For further reading, see my 2012 post&amp;nbsp;&lt;A href="https://stevelionel.com/drfortran/2012/01/05/doctor-fortran-gets-explicit-again/" target="_blank"&gt;Doctor Fortran Gets Explicit - Again! - Doctor Fortran&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 03 May 2026 15:43:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/error-6341-ifx-can-t-compile-line-like-if-aFunction/m-p/1746600#M178783</guid>
      <dc:creator>Steve_Lionel</dc:creator>
      <dc:date>2026-05-03T15:43:06Z</dc:date>
    </item>
    <item>
      <title>Re: error #6341 - ifx can't compile line like: if(aFunction)</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/error-6341-ifx-can-t-compile-line-like-if-aFunction/m-p/1746610#M178784</link>
      <description>&lt;P&gt;The compiler is not clairvoyant when it comes to using functions in a program. In the C programming language, this issue is gotten around by the use of header files. That way the compiler knows how to deal with a function when it encounters it. Of course, most Fortran compilers handle intrinsic functions, which are part of the language standard and are thus well defined, in the manner you are thinking of.&lt;/P&gt;</description>
      <pubDate>Sun, 03 May 2026 21:19:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/error-6341-ifx-can-t-compile-line-like-if-aFunction/m-p/1746610#M178784</guid>
      <dc:creator>witwald</dc:creator>
      <dc:date>2026-05-03T21:19:06Z</dc:date>
    </item>
    <item>
      <title>Re: error #6341 - ifx can't compile line like: if(aFunction)</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/error-6341-ifx-can-t-compile-line-like-if-aFunction/m-p/1746619#M178785</link>
      <description>&lt;P&gt;Thanks all.&lt;/P&gt;&lt;P&gt;I got this question when trying to compile Xeffort.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Look at the code, it is in a module. Like the STRCMP function in xftstrings.f90&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 May 2026 01:07:42 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/error-6341-ifx-can-t-compile-line-like-if-aFunction/m-p/1746619#M178785</guid>
      <dc:creator>cean</dc:creator>
      <dc:date>2026-05-04T01:07:42Z</dc:date>
    </item>
    <item>
      <title>Re: error #6341 - ifx can't compile line like: if(aFunction)</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/error-6341-ifx-can-t-compile-line-like-if-aFunction/m-p/1746713#M178789</link>
      <description>&lt;P&gt;Your example has no module and in no way resembles xftstrings.f90. Which part of xftstrings.f90 do you think is a problem? I can tell you that the original sources build fine with a 32-bit compiler.&lt;/P&gt;</description>
      <pubDate>Mon, 04 May 2026 16:54:22 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/error-6341-ifx-can-t-compile-line-like-if-aFunction/m-p/1746713#M178789</guid>
      <dc:creator>Steve_Lionel</dc:creator>
      <dc:date>2026-05-04T16:54:22Z</dc:date>
    </item>
    <item>
      <title>Re: error #6341 - ifx can't compile line like: if(aFunction)</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/error-6341-ifx-can-t-compile-line-like-if-aFunction/m-p/1746754#M178792</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="e6341.jpg" style="width: 999px;"&gt;&lt;img src="https://community.intel.com/t5/image/serverpage/image-id/72450i5B4D7905ED53C9ED/image-size/large?v=v2&amp;amp;px=999&amp;amp;whitelist-exif-data=Orientation%2CResolution%2COriginalDefaultFinalSize%2CCopyright" role="button" title="e6341.jpg" alt="e6341.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 May 2026 02:19:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/error-6341-ifx-can-t-compile-line-like-if-aFunction/m-p/1746754#M178792</guid>
      <dc:creator>cean</dc:creator>
      <dc:date>2026-05-05T02:19:28Z</dc:date>
    </item>
    <item>
      <title>Re: error #6341 - ifx can't compile line like: if(aFunction)</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/error-6341-ifx-can-t-compile-line-like-if-aFunction/m-p/1746808#M178796</link>
      <description>&lt;P&gt;That error you highlight will be because the module that contains STRCMP has not compiled so the USE association as logical is not seen. These are&amp;nbsp; simple problems you are highlighting and will get you 0.1% down the path of getting an x64 build sorted . I actually have an X64 build after many hundreds if edits and some necessary design modification.&amp;nbsp; &amp;nbsp;It does not successfully run&amp;nbsp; all the sample programs due to&amp;nbsp; run time bugs. My modified X64 version does build and run fine in 32 bit builds....&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 May 2026 10:35:05 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/error-6341-ifx-can-t-compile-line-like-if-aFunction/m-p/1746808#M178796</guid>
      <dc:creator>andrew_4619</dc:creator>
      <dc:date>2026-05-05T10:35:05Z</dc:date>
    </item>
  </channel>
</rss>

