This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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]

Re: option to check that arguments to PACK conform?


Tobias,
You could consider instead of creating a version with asprintf as in
trans-array.c to call a library function.
That way we could improve the error message output (cf. PR28494):

Currently:
Fortran runtime error: Array reference out of bounds for array 'r',
upper bound of dimension 1 exceeded (in file 'array2.f90', at line 4)

With a library function the following is possible:
Fortran runtime error: Array reference out of bounds. Subscript 1 of
array 'r' (value 5) exceeds upper bound of 4 (in file 'array2.f90', at
line 4)"

When extracting the name of the array for the error message consider
also derived types:
The current trans-array.c prints for 'i' exceeding the bounds: 'V'
rather than 'array' for
V(1)%array(i)
The best output would be of cause something like 'v%array'. (PR29800)
Noted, but will get the conformance tests done first :-)

Paul


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