This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Non conforming code or gfortran bug ?
- From: Benjamin Réveillé <benjamin dot reveille at gmail dot com>
- To: fortran at gcc dot gnu dot org
- Date: Mon, 5 Dec 2005 17:05:39 +0100
- Subject: Non conforming code or gfortran bug ?
- 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=MKh0Ylfl9t5vfPbFVC+v1vtB24zKG6JQglGuqHO1pZc+LiP1yhXlvkTOlZlmhnj+4Gm2/9B0CPBwXuSLL+ie4qF4gVsQe3dcUqnI/jL43jcjm5mAAaD4TTRVejtQTF13i+ncjppD+i2tD7z4PlWvkwPNSQ8EuZmjMd3JWLQYTFU=
Hello all
Here is a sample program that illustrates the fact that gfortran
can't escape ' and "
program escaping
implicit none
write(*,*) 'Hello \'World\''
write(*,*) "Hello 'World'"
write(*,*) "Hello \"World\""
write(*,*) 'Hello "World"'
end program escaping
This compiles and runs fine with pgi and xlf returning:
Hello 'World'
Hello 'World'
Hello "World"
Hello "World"
But gfortran fails to compile
In file escaping.f90:3
write(*,*) 'Hello \'World\''
1
Error: Syntax error in WRITE statement at (1)
In file escaping.f90:5
write(*,*) "Hello \"World\""
1
Error: Syntax error in WRITE statement at (1)
Is escaping an extension (i.e. the code is non conforming) or is this
a gfortran bug ?
Thanks for your replies.
Benjamin
P.S.
gfortran -v
Using built-in specs.
Target: i386-linux
Configured with: ../gcc/configure --prefix=/tmp/gfortran-20051205
/irun --enable-languages=c,fortran --host=i386-linux
Thread model: posix
gcc version 4.2.0 20051205 (experimental)