This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
problem with preprocessed f90 code
- From: Magnus Hagdorn <Magnus dot Hagdorn at glg dot ed dot ac dot uk>
- To: fortran at gcc dot gnu dot org
- Date: Tue, 08 Aug 2006 13:01:10 +0100
- Subject: problem with preprocessed f90 code
Hi all,
I am having an obscure problem. I would like to stringify a macro
argument, e.g.
#define MESSAGE(msg) write(*,*) #msg
program test
implicit none
MESSAGE(hello)
end porgram test
if i run
cpp t.F90
I get what I'd expect
program test
implicit none
write(*,*) "hello"
end porgram test
however if i compile it directly i get
gfortran t.F90
In file t.F90:6
write(*,*) #hello
1
Error: Expected expression in WRITE statement at (1)
In file t.F90:7
end porgram test
1
Error: Expecting END PROGRAM statement at (1)
Error: Unexpected end of file in 't.F90'
any suggestions?
cheers
magi