I have a program which uses conditional format tags, similar to this
testcase which is taken from page 187 of Metcalf, Reid and Cohen's
Fortran 95/2003 explained:
---
program testcase
integer :: ival(30),key,i
character(30) :: buffer
character(6) :: form2(3) = (/ '(30i1)', '(15i2)', '(10i3)' /)
read (*, '(a30,i1)') buffer, key
read (buffer, form2 (key)) (ival(i), i=1,30/key)
end
---
When compiled with -std=gnu (gfortran 4.2.2, darwin8), no warning is
issued (which is good). But when compiled with -std=f95 or -std=f2003,
the following error results:
---
nell:~/work/bit barnes$ gfortran -std=f95 testcase.f
testcase.f:7.19:
read (buffer, form2 (key)) (ival(i), i=1,30/key)
1
Error: Extension: Character array in FORMAT tag at (1)
---
Intel Fortran 10 gives no warning or error, at its "-warn all
-stand=f95" level. Is this a gfortran bug or is the Metcalf example bad?