------- Comment #9 from dominiq at lps dot ens dot fr 2010-03-04 10:14 ------- >From http://gcc.gnu.org/ml/fortran/2010-03/msg00020.html
> Currently our default namelist behaviour allows extended reads. > In other words, reading extra data beyond that specified by the array > qualifiers in the namelist file. I don't understand how this applies to the test case. From the manual I get > Expanded namelist reads are permitted. This causes an error if -std=f95 is > used. > In the following example, the first element of the array will be given the > value 0.00 > and the two succeeding elements will be given the values 1.00 and 2.00. > > &MYNML > X(1,1) = 0.00 , 1.00 , 2.00 > / >From this example I understand that X(1,1)=0.0, X(2,1)=1.0, and X(1,2)=2.0 if X is a 2x2 array. In the test in comment #1, the namelist provides 3 values for 3 elements and I do not see any need for "expanded namelist reads". Note that there is no error with -std=f95, only the "expected" behavior. > We turn off this behaviour with -std=f95 or higher. Apparently this is not true for -std=f2008: [macbook] f90/bug% gfc -std=f2008 pr43228.f90 [macbook] f90/bug% a.out 1 4 7 52 6 8 261 0 9 only f95 and f2003. > I am thinking the extended reads should be allowed with -std=legacy > and have -std=gnu use the non extended reads as default. I'ld vote for -std=legacy only. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43228