<?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 Feature request: warn about duplicate USE in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Feature-request-warn-about-duplicate-USE/m-p/774975#M24548</link>
    <description>The previous diagnostic was considered a bug that we fixed - especially with separate USE. Again, while it may seem parallel to a duplicate declaration, it isn't.</description>
    <pubDate>Thu, 12 Jul 2012 19:52:59 GMT</pubDate>
    <dc:creator>Steven_L_Intel1</dc:creator>
    <dc:date>2012-07-12T19:52:59Z</dc:date>
    <item>
      <title>Feature request: warn about duplicate USE</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Feature-request-warn-about-duplicate-USE/m-p/774965#M24538</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I'd like to see the Intel compiler at least give a warning if a USE is duplicated, viz,&lt;BR /&gt;&lt;BR /&gt;% cat &amp;gt; duplicate_use.f90 &amp;lt;&amp;lt; EOF&lt;BR /&gt;module mod&lt;BR /&gt; integer :: var = 0&lt;BR /&gt;end module&lt;BR /&gt;&lt;BR /&gt;program duplicate_use&lt;BR /&gt; use mod, only: var&lt;BR /&gt; use mod, only: var ! should produce error&lt;BR /&gt; print*, var&lt;BR /&gt;end program&lt;BR /&gt;EOF&lt;BR /&gt;&lt;BR /&gt;% ifort --version | head -1&lt;BR /&gt;ifort (IFORT) 12.1.3 20120212&lt;BR /&gt;&lt;BR /&gt;% ifort -c -warn -check duplicate_use.f90&lt;BR /&gt;[no complaints]&lt;BR /&gt;&lt;BR /&gt;It's antecedent does:&lt;BR /&gt;&lt;BR /&gt;alpha% fort -what&lt;BR /&gt; Compaq Fortran V1.2.0-1882&lt;BR /&gt; Compaq Fortran Compiler V1.2.0-1882-48BBF&lt;BR /&gt;&lt;BR /&gt;alpha% fort -c duplicate_use.f90 &lt;BR /&gt;f90: Warning: duplicate_use.f90, line 6: Conflicting attributes or multiple declaration of name. [VAR]&lt;BR /&gt; use mod, only: var&lt;BR /&gt;-----------------^&lt;BR /&gt;f90: Error: duplicate_use.f90, line 8: The same named entity from different modules and/or program units cannot be referenced. [VAR]&lt;BR /&gt; print*, var&lt;BR /&gt;----------^&lt;BR /&gt;&lt;BR /&gt;Thanks for consideration,&lt;BR /&gt;--&lt;BR /&gt;Bil, 757.812.1805&lt;BR /&gt;</description>
      <pubDate>Thu, 12 Jul 2012 11:41:54 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Feature-request-warn-about-duplicate-USE/m-p/774965#M24538</guid>
      <dc:creator>w_l_kleb</dc:creator>
      <dc:date>2012-07-12T11:41:54Z</dc:date>
    </item>
    <item>
      <title>Feature request: warn about duplicate USE</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Feature-request-warn-about-duplicate-USE/m-p/774966#M24539</link>
      <description>&lt;PRE class="bz_comment_text"&gt;More by way of &lt;A href="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53940" target="_blank"&gt;http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53940&lt;/A&gt; feedback...&lt;BR /&gt;&lt;BR /&gt;I see the USE ONLY as similar to a declaration, and to have two of the same declarations in a program is an error, e.g.,

$ cat duplicate_declaration.f90 &amp;lt;&amp;lt; EOF
program duplicate_declaration
  integer :: var
  integer :: var ! should produce at least a warning?
  var = 1
  print*, var
end program
EOF

% ifort -warn -check duplicate_declaration.f90 &lt;BR /&gt;duplicate_declaration.f90(3): error #6418: This name has already been assigned a data type. [VAR]&lt;BR /&gt; integer :: var ! should produce at least a warning?&lt;BR /&gt;-------------^&lt;BR /&gt;compilation aborted for duplicate_declaration.f90 (code 1)

While the USE ONLY error is mostly harmless, we find it useful to know about to keep our code clean.&lt;/PRE&gt;</description>
      <pubDate>Thu, 12 Jul 2012 13:39:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Feature-request-warn-about-duplicate-USE/m-p/774966#M24539</guid>
      <dc:creator>w_l_kleb</dc:creator>
      <dc:date>2012-07-12T13:39:50Z</dc:date>
    </item>
    <item>
      <title>Feature request: warn about duplicate USE</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Feature-request-warn-about-duplicate-USE/m-p/774967#M24540</link>
      <description>You may see it as similar to a declaration, but the standard does not.&lt;BR /&gt;&lt;BR /&gt;"More than one USE statement for a given module may appear in a specification part. If one of the USE statements is without an ONLY option, all public entities in the module are accessible. If all of the USE statements have ONLY options, only those entities in one or more of the only-lists are accessible."&lt;BR /&gt;&lt;BR /&gt;F2008, section 11.2.2, paragraph 6&lt;BR /&gt;&lt;BR /&gt;The multiple USEs are legal and no warning or error should be produced.</description>
      <pubDate>Thu, 12 Jul 2012 13:55:21 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Feature-request-warn-about-duplicate-USE/m-p/774967#M24540</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2012-07-12T13:55:21Z</dc:date>
    </item>
    <item>
      <title>Feature request: warn about duplicate USE</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Feature-request-warn-about-duplicate-USE/m-p/774968#M24541</link>
      <description>Multiple USEs are legal, but multiple USE-ONLYs of the same variable would not seem to be a reasonable?</description>
      <pubDate>Thu, 12 Jul 2012 14:33:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Feature-request-warn-about-duplicate-USE/m-p/774968#M24541</guid>
      <dc:creator>w_l_kleb</dc:creator>
      <dc:date>2012-07-12T14:33:13Z</dc:date>
    </item>
    <item>
      <title>Feature request: warn about duplicate USE</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Feature-request-warn-about-duplicate-USE/m-p/774969#M24542</link>
      <description>The standard explicitly says it's ok (see the last sentence of the quote). I see no basis for issuing a warning here.</description>
      <pubDate>Thu, 12 Jul 2012 15:02:29 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Feature-request-warn-about-duplicate-USE/m-p/774969#M24542</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2012-07-12T15:02:29Z</dc:date>
    </item>
    <item>
      <title>Feature request: warn about duplicate USE</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Feature-request-warn-about-duplicate-USE/m-p/774970#M24543</link>
      <description>I think my original example conflates to things.&lt;BR /&gt;
&lt;BR /&gt;
Would you agree that it would be helpful to receive a warning for the following?&lt;BR /&gt;
&lt;BR /&gt;
use module_a, only : var, var&lt;BR /&gt;
&lt;BR /&gt;
I.e., repeated instantiation of "var".</description>
      <pubDate>Thu, 12 Jul 2012 15:11:27 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Feature-request-warn-about-duplicate-USE/m-p/774970#M24543</guid>
      <dc:creator>w_l_kleb</dc:creator>
      <dc:date>2012-07-12T15:11:27Z</dc:date>
    </item>
    <item>
      <title>Feature request: warn about duplicate USE</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Feature-request-warn-about-duplicate-USE/m-p/774971#M24544</link>
      <description>To be honest, not really. It's conceptually no different than having it on two different USE statements and does no harm. There's nothing in the standard that would support giving a warning here.</description>
      <pubDate>Thu, 12 Jul 2012 15:58:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Feature-request-warn-about-duplicate-USE/m-p/774971#M24544</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2012-07-12T15:58:36Z</dc:date>
    </item>
    <item>
      <title>Feature request: warn about duplicate USE</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Feature-request-warn-about-duplicate-USE/m-p/774972#M24545</link>
      <description>Likewise, I don't read the standard to say you couldn't provide a warning?&lt;BR /&gt;&lt;BR /&gt;FWIW, it looks like gfortran will eventually: &lt;A href="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53940" target="_blank"&gt;http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53940&lt;/A&gt;&lt;BR /&gt;and so we'll probably use that for our compiler diagnostic builds.</description>
      <pubDate>Thu, 12 Jul 2012 17:16:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Feature-request-warn-about-duplicate-USE/m-p/774972#M24545</guid>
      <dc:creator>w_l_kleb</dc:creator>
      <dc:date>2012-07-12T17:16:36Z</dc:date>
    </item>
    <item>
      <title>Feature request: warn about duplicate USE</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Feature-request-warn-about-duplicate-USE/m-p/774973#M24546</link>
      <description>I don't draw the same conclusion you do from Tobias' comments. If you want a compiler for diagnostic builds, try NAG. We're happy to add warnings for things that may be harmful even if legal - we have a class of "usage" diagnostics - but this to me does not rise to that level. &lt;BR /&gt;&lt;BR /&gt;Think about the circumstances where such a "mistake" might appear. Let's say that the programmer has some (unfortunately named) variables C1,C2,C3 in a module. He then writes:&lt;BR /&gt;&lt;BR /&gt;USE MODNAME, ONLY: C1,C1,C3&lt;BR /&gt;&lt;BR /&gt;where C2 was meant for the second symbol. So what happens? If C2 is referenced in the body of the program unit, it will probably trigger an error for an undeclared symbol (assuming IMPLICIT NONE). If it isn't used, so what?</description>
      <pubDate>Thu, 12 Jul 2012 18:35:21 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Feature-request-warn-about-duplicate-USE/m-p/774973#M24546</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2012-07-12T18:35:21Z</dc:date>
    </item>
    <item>
      <title>Feature request: warn about duplicate USE</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Feature-request-warn-about-duplicate-USE/m-p/774974#M24547</link>
      <description>For whatever reason, our developers like the DEC's warnings about duplicate USE'd variables; and I don't see the downside of a usage warning about C1 being included twice. Again, it seems very parallel (an illegal) duplicate declaration sitatuation.</description>
      <pubDate>Thu, 12 Jul 2012 18:41:33 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Feature-request-warn-about-duplicate-USE/m-p/774974#M24547</guid>
      <dc:creator>w_l_kleb</dc:creator>
      <dc:date>2012-07-12T18:41:33Z</dc:date>
    </item>
    <item>
      <title>Feature request: warn about duplicate USE</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Feature-request-warn-about-duplicate-USE/m-p/774975#M24548</link>
      <description>The previous diagnostic was considered a bug that we fixed - especially with separate USE. Again, while it may seem parallel to a duplicate declaration, it isn't.</description>
      <pubDate>Thu, 12 Jul 2012 19:52:59 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Feature-request-warn-about-duplicate-USE/m-p/774975#M24548</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2012-07-12T19:52:59Z</dc:date>
    </item>
  </channel>
</rss>

