<?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 I wrote a comprehensive test in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/array-definition-warning-desired/m-p/1099395#M126390</link>
    <description>&lt;P&gt;I wrote a comprehensive test for this issue, and it all worked correctly. ifort doesn't complain about a repeated length or dimension or codimension. What happened in post 1 was that both declarations of foo were uncommented, and the compiler correctly complained about a duplicate declaration.&lt;/P&gt;</description>
    <pubDate>Thu, 23 Feb 2017 14:34:59 GMT</pubDate>
    <dc:creator>Steve_Lionel</dc:creator>
    <dc:date>2017-02-23T14:34:59Z</dc:date>
    <item>
      <title>array definition: warning desired</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/array-definition-warning-desired/m-p/1099381#M126376</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;the following code is accepted by ifort 17.0.1. A warning or error for line 6 would be perfect. The contradictory double definition in line 9 is checked and an error is given, but line 6 is accepted.&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;program array_definition
  use ISO_FORTRAN_ENV, only : rk =&amp;gt; real64
  implicit none
  
  ! Variables
  real(rk), dimension(10) :: foo(10)  ! this shouldn't work, should it? --&amp;gt; no error or warning is given
  
  
  !real(rk), dimension(10) :: foo(20)  ! this shouldn't work also! And it works not...
  !  1&amp;gt;------ Build started: Project: array_definition, Configuration: Debug Win32 ------
  !  1&amp;gt;Compiling with Intel(R) Visual Fortran Compiler 17.0.1.143 [IA-32]...
  !  1&amp;gt;array_definition.f90
  !  1&amp;gt;D:\02_Fortran\99_test\array_definition\array_definition.f90(7): error #6417: The dimensions of this array have been defined more than once.   [FOO]
  !  1&amp;gt;D:\02_Fortran\99_test\array_definition\array_definition.f90(6): remark #7712: This variable has not been used.   [FOO]
  !  1&amp;gt;compilation aborted for D:\02_Fortran\99_test\array_definition\array_definition.f90 (code 1)
  
end program array_definition&lt;/PRE&gt;

&lt;P&gt;Maybe it is easy to implement?&lt;/P&gt;

&lt;P&gt;Kind regards, Johannes&lt;/P&gt;</description>
      <pubDate>Mon, 20 Feb 2017 14:52:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/array-definition-warning-desired/m-p/1099381#M126376</guid>
      <dc:creator>Johannes_Rieke</dc:creator>
      <dc:date>2017-02-20T14:52:13Z</dc:date>
    </item>
    <item>
      <title>The standard allows this</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/array-definition-warning-desired/m-p/1099382#M126377</link>
      <description>&lt;P&gt;The standard allows this explicitly:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
	&lt;P&gt;The type declaration statement also specifies the attributes whose keywords appear in the attr-spec, except that the DIMENSION attribute may be specified or overridden for an entity by the appearance of array-spec in its entity-decl, and the CODIMENSION attribute may be specified or overridden for an entity by the appe&lt;SPAN style="font-size: 1em;"&gt;arance of coarray-spec in its entity-decl.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;This is the sort of thing I have advocated putting under a "usage warnings" option - usage that is legal but is questionable or prone to issues (such as mixed-mode arithmetic).&lt;/P&gt;</description>
      <pubDate>Mon, 20 Feb 2017 15:53:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/array-definition-warning-desired/m-p/1099382#M126377</guid>
      <dc:creator>Steve_Lionel</dc:creator>
      <dc:date>2017-02-20T15:53:48Z</dc:date>
    </item>
    <item>
      <title>&gt;&gt;The standard allows this</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/array-definition-warning-desired/m-p/1099383#M126378</link>
      <description>&lt;P&gt;&amp;gt;&amp;gt;The standard allows this explicitly&lt;/P&gt;

&lt;P&gt;Then the error message when the dimension did not match is wrong. When&lt;/P&gt;

&lt;P&gt;real(rk), dimension(10) :: foo(20)&lt;/P&gt;

&lt;P&gt;used.&lt;/P&gt;

&lt;P&gt;Jim Dempsey&lt;/P&gt;</description>
      <pubDate>Mon, 20 Feb 2017 16:00:39 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/array-definition-warning-desired/m-p/1099383#M126378</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2017-02-20T16:00:39Z</dc:date>
    </item>
    <item>
      <title>Yup.</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/array-definition-warning-desired/m-p/1099384#M126379</link>
      <description>&lt;P&gt;Yup.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Feb 2017 16:21:15 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/array-definition-warning-desired/m-p/1099384#M126379</guid>
      <dc:creator>Steve_Lionel</dc:creator>
      <dc:date>2017-02-20T16:21:15Z</dc:date>
    </item>
    <item>
      <title>Thanks Steve and Jim,</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/array-definition-warning-desired/m-p/1099385#M126380</link>
      <description>&lt;P&gt;Thanks Steve and Jim,&lt;/P&gt;

&lt;P&gt;I agree Jim. This works without warning:&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;  real(rk), dimension(20) :: foo(10)  ! this shouldn't work, should it? --&amp;gt; a warning is given
  write(*,*) size(foo)                ! -&amp;gt; 10
  !  1&amp;gt;------ Build started: Project: array_definition, Configuration: Debug Win32 ------
  !  1&amp;gt;Compiling with Intel(R) Visual Fortran Compiler 17.0.1.143 [IA-32]...
  !  1&amp;gt;array_definition.f90&lt;/PRE&gt;

&lt;P&gt;But the other way round an error is thrown:&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;real(rk), dimension(10) :: foo(20)  ! this shouldn't work also! And it works not...
  !write(*,*) size(foo)                ! -&amp;gt; should be 20
  !  1&amp;gt;------ Build started: Project: array_definition, Configuration: Debug Win32 ------
  !  1&amp;gt;Compiling with Intel(R) Visual Fortran Compiler 17.0.1.143 [IA-32]...
  !  1&amp;gt;array_definition.f90
  !  1&amp;gt;   \array_definition.f90(7): error #6417: The dimensions of this array have been defined more than once.   [FOO]
  !  1&amp;gt;   \array_definition.f90(6): remark #7712: This variable has not been used.   [FOO]
  !  1&amp;gt;compilation aborted for    \array_definition\array_definition.f90 (code 1)&lt;/PRE&gt;

&lt;P&gt;Is this an compiler issue?&lt;/P&gt;

&lt;P&gt;Best regards, Johannes&lt;/P&gt;</description>
      <pubDate>Mon, 20 Feb 2017 16:21:43 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/array-definition-warning-desired/m-p/1099385#M126380</guid>
      <dc:creator>Johannes_Rieke</dc:creator>
      <dc:date>2017-02-20T16:21:43Z</dc:date>
    </item>
    <item>
      <title>Yes, it's a compiler bug.  In</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/array-definition-warning-desired/m-p/1099386#M126381</link>
      <description>&lt;P&gt;Yes, it's a compiler bug. &amp;nbsp;In both cases the array specification attached to the variable overrides the DIMENSION. Confusing for the reader, to be sure.&lt;/P&gt;

&lt;P&gt;The same principle applies to character lengths. For example:&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;character(10) :: foo*20
&lt;/PRE&gt;

&lt;P&gt;The (10) is overridden by the *20.&lt;/P&gt;

&lt;P&gt;Intel Fortran gets this one right.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Feb 2017 20:10:47 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/array-definition-warning-desired/m-p/1099386#M126381</guid>
      <dc:creator>Steve_Lionel</dc:creator>
      <dc:date>2017-02-20T20:10:47Z</dc:date>
    </item>
    <item>
      <title>Hi Steve, dear all,</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/array-definition-warning-desired/m-p/1099387#M126382</link>
      <description>&lt;P&gt;Hi Steve, dear all,&lt;/P&gt;

&lt;P&gt;that's good to know. Hopefully this misleading functionality will be erased from the standard in future. Can anyone imagine what this is good for? Especially in case of the character length definition it seems to me extremely strange. I thought&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;character(len=10) :: foo&lt;/PRE&gt;

&lt;P&gt;is the 'newer' one than&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;character :: foo*10&lt;/PRE&gt;

&lt;P&gt;I would have suggested that the 'newer' format overrides the older one... Nevertheless, if array-spec overrides dimension, it's logical that this is also valid for characters, isn't it.&lt;/P&gt;

&lt;P&gt;@Intel team: can you open a defect record for the compiler error seen in opener (line 9), please. An optional "usage warning", as Steve suggested, would be fine, too. In most cases, I think, it's not the intent of the coders to have this double definition. If the warning shows in addition the actual size/length accepted would also be fine.&lt;/P&gt;

&lt;P&gt;Best regards, Johannes&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Feb 2017 08:35:20 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/array-definition-warning-desired/m-p/1099387#M126382</guid>
      <dc:creator>Johannes_Rieke</dc:creator>
      <dc:date>2017-02-21T08:35:20Z</dc:date>
    </item>
    <item>
      <title>I will submit defect reports</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/array-definition-warning-desired/m-p/1099388#M126383</link>
      <description>&lt;P&gt;I will submit defect reports shortly for the issues discussed.&lt;/P&gt;

&lt;P&gt;(Internal tracking id: TBD)&lt;/P&gt;</description>
      <pubDate>Tue, 21 Feb 2017 18:26:08 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/array-definition-warning-desired/m-p/1099388#M126383</guid>
      <dc:creator>Kevin_D_Intel</dc:creator>
      <dc:date>2017-02-21T18:26:08Z</dc:date>
    </item>
    <item>
      <title>It's an interesting idea to</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/array-definition-warning-desired/m-p/1099389#M126384</link>
      <description>&lt;P&gt;It's an interesting idea to deprecate having both specifications - I don't recall it ever coming up before while I've been on the committee. Note that in the character case F77 allowed you to say:&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;character*10 foo*20&lt;/PRE&gt;

&lt;P&gt;In fact I recall fixing a bug in VAX Fortran that rejected that. The "character*10" form is deprecated, but still standard.&lt;/P&gt;

&lt;P&gt;I can't think of another place in the standard that allows duplicated specifications, especially those that conflict!&lt;/P&gt;</description>
      <pubDate>Tue, 21 Feb 2017 18:43:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/array-definition-warning-desired/m-p/1099389#M126384</guid>
      <dc:creator>Steve_Lionel</dc:creator>
      <dc:date>2017-02-21T18:43:16Z</dc:date>
    </item>
    <item>
      <title>It's getting even more weird</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/array-definition-warning-desired/m-p/1099390#M126385</link>
      <description>&lt;P&gt;It's getting even more weird to me. This one also compiles without error or warning following the override logic:&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;character(len=10), dimension(30)            :: foo2*50(20)
! or 
character*10     , dimension(30)            :: foo3*50(20)&lt;/PRE&gt;

&lt;P&gt;I don't think that this makes sense to be allowed by the Fortran standard.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Feb 2017 08:21:01 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/array-definition-warning-desired/m-p/1099390#M126385</guid>
      <dc:creator>Johannes_Rieke</dc:creator>
      <dc:date>2017-02-22T08:21:01Z</dc:date>
    </item>
    <item>
      <title>It is allowed, though I might</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/array-definition-warning-desired/m-p/1099391#M126386</link>
      <description>&lt;P&gt;It is allowed, though I might agree that it shouldn't be.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Feb 2017 13:59:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/array-definition-warning-desired/m-p/1099391#M126386</guid>
      <dc:creator>Steve_Lionel</dc:creator>
      <dc:date>2017-02-22T13:59:37Z</dc:date>
    </item>
    <item>
      <title>`character :: x` is a synonym</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/array-definition-warning-desired/m-p/1099392#M126387</link>
      <description>&lt;P&gt;`character :: x` is a synonym for `character(LEN=1) :: x`, hence any specification of character length in an entity-decl is effectively an override.&amp;nbsp; It doesn't concern me particularly due to my personal coding style, but I suspect that deleting specification of character length in an entity-decl would result in wide-spread civil insurrection.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;(If there's even a hint of deleting specification of an array's dimension stuff in an entity-decl, then I'll be out on the streets creating mayhem and havoc too.)&lt;/P&gt;

&lt;P&gt;&lt;BR /&gt;
	&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2017 09:05:55 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/array-definition-warning-desired/m-p/1099392#M126387</guid>
      <dc:creator>IanH</dc:creator>
      <dc:date>2017-02-23T09:05:55Z</dc:date>
    </item>
    <item>
      <title>Hi Ian,</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/array-definition-warning-desired/m-p/1099393#M126388</link>
      <description>&lt;P&gt;Hi Ian,&lt;/P&gt;

&lt;P&gt;OK, that sounds complicated. My idea was just to find a way to avoid the ugly constructs above, e.g.&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;character(len=10), dimension(30) :: foo2*50(20)&lt;/PRE&gt;

&lt;P&gt;If it can't be done without destroying compatibility, a warning would be fine. Anyone who wants can configure this warning so that it is treated as an error.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2017 09:39:38 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/array-definition-warning-desired/m-p/1099393#M126388</guid>
      <dc:creator>Johannes_Rieke</dc:creator>
      <dc:date>2017-02-23T09:39:38Z</dc:date>
    </item>
    <item>
      <title>I ran this by the committee</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/array-definition-warning-desired/m-p/1099394#M126389</link>
      <description>&lt;P&gt;I ran this by the committee members and got general agreement that having two specifications for length, bounds or cobounds should be deprecated in the next (post-2015) standard. This would enable compilers to give standards warnings for this usage. It's not clear to me that I can make a formal proposal yet, as the gates haven't been opened for that yet.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2017 13:26:39 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/array-definition-warning-desired/m-p/1099394#M126389</guid>
      <dc:creator>Steve_Lionel</dc:creator>
      <dc:date>2017-02-23T13:26:39Z</dc:date>
    </item>
    <item>
      <title>I wrote a comprehensive test</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/array-definition-warning-desired/m-p/1099395#M126390</link>
      <description>&lt;P&gt;I wrote a comprehensive test for this issue, and it all worked correctly. ifort doesn't complain about a repeated length or dimension or codimension. What happened in post 1 was that both declarations of foo were uncommented, and the compiler correctly complained about a duplicate declaration.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2017 14:34:59 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/array-definition-warning-desired/m-p/1099395#M126390</guid>
      <dc:creator>Steve_Lionel</dc:creator>
      <dc:date>2017-02-23T14:34:59Z</dc:date>
    </item>
    <item>
      <title>Ah, sorry for causing</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/array-definition-warning-desired/m-p/1099396#M126391</link>
      <description>&lt;P&gt;Ah, sorry for causing confusion about that error message. I misunderstood that one. That's clear a double definition of foo in post 1. The error text might be a little misleading. Anyway, good to know that ifort is compliant to the standard and that's not a bug. Nevertheless the topic was very interesting.&lt;/P&gt;

&lt;P&gt;Big thanks to you, Steve!&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2017 14:48:59 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/array-definition-warning-desired/m-p/1099396#M126391</guid>
      <dc:creator>Johannes_Rieke</dc:creator>
      <dc:date>2017-02-23T14:48:59Z</dc:date>
    </item>
  </channel>
</rss>

