problem with preprocessed f90 code
Magnus Hagdorn
Magnus.Hagdorn@glg.ed.ac.uk
Tue Aug 8 12:01:00 GMT 2006
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
More information about the Fortran
mailing list