https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109099

--- Comment #2 from urbanjost at comcast dot net ---
Created attachment 54640
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54640&action=edit
interactive program for trying out NAMELIST group input

This may be an "oops" after all; looks like I have been depending on a
non-standard behavior after reviewing your comment and trying to find in the
standard what should happen. Ends up there is a statement that if the LHS
describes a scalar value the RHS can only have one value that I had not
noticed.

After trying the  attached interactive program with several compilers and
reading the latest version of the Fortran standard, it appears to be an
extension to follow x(2,3)= by more than one value, although so far NAG is the
only one that warns or gives an error per the previous comment (I do not have
access to nagfor(1) currently). 

The correct way to just fill in array order appears to be to use null values
and have the LHS be the array name:

    x=9*,1,2,3

which would start filling on the tenth value regardless of the shape of x,
apparently.  For the case of a vector  x(10:)=1,2,3  would also be defined by
the standard. For multiple dimensions I guess you just have to figure out the
number of null values to use instead of giving a starting "address". 

Thanks for the review, but although I have used this syntax for a very long
time it is apparently (now?) an extension to allow it, so behavior can
legitimately vary.

Reply via email to