------- Comment #2 from paulthomas2 at wanadoo dot fr 2007-04-11 21:05 ------- Subject: Re: result_in_spec_1.f90: Invalid write
Tobias, > however, test(1) returns an array of the size (2*1+1)+1 = 4. > Thanks for spotting that one. I'm just in the process of committing the fix as 'obvious', if a very sluggish network will permit. > gfortran's -fbounds-check message is a bit misleading, though: > > Fortran runtime error: Array bound mismatch for dimension 1 of array 'r' (in > file '/home/tob/projects/gcc/gcc/testsuite/gfortran.dg/result_in_spec_1.f90', > at line 22) > > I think NAG f95's is better: > > Rank 1 of array operand has extent 4 instead of 2 > In MYFUNC, line 42 of result_in_spec_1.f90 > > Line 22 is: > do i = 1, len(r) > where "r" is function result character(len=3),dimension(4). And line 42 is: > chr = test2 (1) > > The test case needs to be fixed, the question is whether the bounding error > should be improved too? > Yes, the line number should certainly be put right. Cheers Paul > > -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31538