<?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 suggestion for a new warning in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/suggestion-for-a-new-warning/m-p/743575#M2322</link>
    <description>&lt;DIV id="tiny_quote"&gt;
&lt;DIV style="margin-left: 2px; margin-right: 2px;"&gt;Quoting &lt;A rel="/en-us/services/profile/quick_profile.php?is_paid=&amp;amp;user_id=336209" class="basic" href="https://community.intel.com/en-us/profile/336209/"&gt;Steve Lionel (Intel)&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color: #e5e5e5; padding: 5px; border: 1px inset; margin-left: 2px; margin-right: 2px;"&gt;&lt;I&gt;The compiler really has no way of knowing this at compile time. You could use some other means than PRESENT to test for the argument. It would require some sort of code flow analysis and could be fooled if you passed the optional argument to another routine. You will very likely get a segfault at run-time if you access an omitted argument.&lt;/I&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;I see... Thanks for your answer.&lt;/P&gt;
&lt;P&gt;Seems to me that if a procedure has an optional dummy foo and there is no present(foo) anywhere in the procedure, that would be a good enough reason to issue a warning, or at least an info.&lt;/P&gt;
&lt;P&gt;I can't remember whether it was ifort or gfortran, but I'm pretty sure I've seen warnings from a -check uninit-like option (~ "this variable is used but may be uninitialized") which were sometimes wrong (perhaps because their rules were too simple), but they are still very useful..&lt;/P&gt;
&lt;P&gt;In other words, isn't an info or warning message, if phrase appropriately ("may", "appears to be"), allowed to be wrong?&lt;/P&gt;
&lt;P&gt;Doesn't your argument above apply equally to -check uninit?&lt;/P&gt;</description>
    <pubDate>Fri, 29 Jan 2010 21:49:59 GMT</pubDate>
    <dc:creator>Alexis_R_</dc:creator>
    <dc:date>2010-01-29T21:49:59Z</dc:date>
    <item>
      <title>suggestion for a new warning</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/suggestion-for-a-new-warning/m-p/743573#M2320</link>
      <description>&lt;P&gt;Call me lazy, but I love to rely on the compiler's warnings to help me write better code faster. One mistake I make occasionally is forgetting to check whether an optional dummy argument was present. I would really like ifort to tell me when any dummy argument's presence hasn't been checked within the procedure.&lt;/P&gt;
&lt;P&gt;E.g. compiling this with -warn all should give a warning about "norm"...&lt;/P&gt;
&lt;P&gt;
&lt;PRE&gt;[fortran]module testmod1
	contains
	real function fn(a,b,norm)
		implicit none
		real, intent(in) :: a
		real, intent(in) :: b
		real, optional, intent(in) :: norm
		!
		fn = a/norm + b
	end function fn
end module

program test
	use testmod1
	print *, fn(1.2,3.14,200.1)
end program[/fortran]&lt;/PRE&gt;
&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Is there some reason why this warning does not exist?&lt;/P&gt;
&lt;P&gt;I hope this forum is an appropriate place to make suggestions like this.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jan 2010 20:44:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/suggestion-for-a-new-warning/m-p/743573#M2320</guid>
      <dc:creator>Alexis_R_</dc:creator>
      <dc:date>2010-01-29T20:44:56Z</dc:date>
    </item>
    <item>
      <title>suggestion for a new warning</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/suggestion-for-a-new-warning/m-p/743574#M2321</link>
      <description>The compiler really has no way of knowing this at compile time. You could use some other means than PRESENT to test for the argument. It would require some sort of code flow analysis and could be fooled if you passed the optional argument to another routine. You will very likely get a segfault at run-time if you access an omitted argument.</description>
      <pubDate>Fri, 29 Jan 2010 21:31:20 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/suggestion-for-a-new-warning/m-p/743574#M2321</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2010-01-29T21:31:20Z</dc:date>
    </item>
    <item>
      <title>suggestion for a new warning</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/suggestion-for-a-new-warning/m-p/743575#M2322</link>
      <description>&lt;DIV id="tiny_quote"&gt;
&lt;DIV style="margin-left: 2px; margin-right: 2px;"&gt;Quoting &lt;A rel="/en-us/services/profile/quick_profile.php?is_paid=&amp;amp;user_id=336209" class="basic" href="https://community.intel.com/en-us/profile/336209/"&gt;Steve Lionel (Intel)&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color: #e5e5e5; padding: 5px; border: 1px inset; margin-left: 2px; margin-right: 2px;"&gt;&lt;I&gt;The compiler really has no way of knowing this at compile time. You could use some other means than PRESENT to test for the argument. It would require some sort of code flow analysis and could be fooled if you passed the optional argument to another routine. You will very likely get a segfault at run-time if you access an omitted argument.&lt;/I&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;I see... Thanks for your answer.&lt;/P&gt;
&lt;P&gt;Seems to me that if a procedure has an optional dummy foo and there is no present(foo) anywhere in the procedure, that would be a good enough reason to issue a warning, or at least an info.&lt;/P&gt;
&lt;P&gt;I can't remember whether it was ifort or gfortran, but I'm pretty sure I've seen warnings from a -check uninit-like option (~ "this variable is used but may be uninitialized") which were sometimes wrong (perhaps because their rules were too simple), but they are still very useful..&lt;/P&gt;
&lt;P&gt;In other words, isn't an info or warning message, if phrase appropriately ("may", "appears to be"), allowed to be wrong?&lt;/P&gt;
&lt;P&gt;Doesn't your argument above apply equally to -check uninit?&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jan 2010 21:49:59 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/suggestion-for-a-new-warning/m-p/743575#M2322</guid>
      <dc:creator>Alexis_R_</dc:creator>
      <dc:date>2010-01-29T21:49:59Z</dc:date>
    </item>
    <item>
      <title>suggestion for a new warning</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/suggestion-for-a-new-warning/m-p/743576#M2323</link>
      <description>&lt;P&gt;We could add a run-time check which is what -check uninit does. But as I mentioned you're going to get an error anyway - a segfault. As I mentioned earlier, PRESENT is not the only way you can avoid referencing an omitted argument.&lt;/P&gt;
&lt;P&gt;I will add a feature request on your behalf.&lt;/P&gt;</description>
      <pubDate>Sat, 30 Jan 2010 21:02:57 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/suggestion-for-a-new-warning/m-p/743576#M2323</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2010-01-30T21:02:57Z</dc:date>
    </item>
    <item>
      <title>suggestion for a new warning</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/suggestion-for-a-new-warning/m-p/743577#M2324</link>
      <description>Thanks Steve, this was clearly a half-baked idea, but maybe there's a useful feature in there somewhere :)</description>
      <pubDate>Sun, 31 Jan 2010 18:26:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/suggestion-for-a-new-warning/m-p/743577#M2324</guid>
      <dc:creator>Alexis_R_</dc:creator>
      <dc:date>2010-01-31T18:26:13Z</dc:date>
    </item>
  </channel>
</rss>

