This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Parenthesis and goup write.
- From: Benjamin Réveillé <benjamin dot reveille at gmail dot com>
- To: fortran at gcc dot gnu dot org
- Date: Tue, 6 Dec 2005 10:40:00 +0100
- Subject: Parenthesis and goup write.
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=No3y4V9hjhqowyp2A/7qN2x6YP5e364QFOqW8xNF2OO9Pgsasa0lQ6OdwYl/j1kV/Eb4fGjXUbK3tMuEQstJbmHMbDnBoQ8U9yXtIRe+KHvnOdYnhT0HwKjRL8FrZKF4vPPOXthyo72aQ7+EAYuAKrAozyeEa1YLDOnIwhhXNiM=
Hello again
Here is another sample program:
program group
implicit none
integer, parameter :: nb=2
integer :: n
real(kind(0.d0)), dimension(nb) :: angi, angf
do n=1,nb
angi(n)=-dble(n)
angf(n)=dble(n)
end do
write(*,'(e12.5,1x,e12.5)') ((angi(n),angf(n)),n=1,nb)
end program group
This compiles fine with intel 8.1, pgi 5.1, ibm xlf, sgi mipspro 7
but gfortran issues:
In file group.f90:12
write(*,'(e12.5,1x,e12.5)') ((angi(n),angf(n)),n=1,nb)
1
Error: Expected a right parenthesis in expression at (1)
If I change the write statement to
write(*,'(e12.5,1x,e12.5)') (angi(n),angf(n),n=1,nb)
Then it compiles and runs fine. I usualy add the extra parenthesis so
as to make very clear that the 2 arrays are iterated on. I agree it
may not be useful, but I did not expect it to be incorrect. Does
someone have an explanation.
If the standard forbids it I'll get rid of a "bad" habit, if not I
guess it's a gfortran bug.
Thanks
Benjamin