This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libfortran/39668] Wrongly read namelist with two dimensional array.



------- Comment #7 from toon at moene dot org  2009-08-18 16:40 -------
The relevant wording in the Standard (2003) is:

9.5.3.4 Data transfer

...

The list items for a namelist input statement are processed in the order of the
entities specified within the input records.

...

To spell  it out for this example:

1 is assigned to i(1,1)
2 is assigned to i(2,1) ! Array element order, as no other order is specified.
3 is assigned to i(3,1) ! Ditto.
4 is assigned to i(2,1) ! Overwriting the 2 that was there.
5 is assigned to i(3,1) ! Overwriting the 3 that was there.
6 is assigned to i(2,2) ! Got that ?
7 is assigned to i(3,1) ! Overwriting the 5 that was there.
8 is assigned to i(3,2) ! Hah !
9 is assigned to i(3,3) ! So there !

i(1,2), i(1,3) and i(2,3) are never set via the namelist I/O and remain at 0.

So printing the namelist will get you: 1, 4, 7, 0 (=i(1,2)), 6, 8, 0 (=i(1,3)),
0 (=i(2,3)), 9

which seems perfectly OK with me.

Closing the bug report as INVALID, i.e., not a bug.


-- 

toon at moene dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39668


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]