This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: problem with preprocessed f90 code
Hi all,
Magnus Hagdorn schrieb:
> #define MESSAGE(msg) write(*,*) #msg
> if i run
> cpp t.F90
> I get what I'd expect
> however if i compile it directly i get
> gfortran t.F90
> write(*,*) #hello
> any suggestions?
I don't have any suggestion, but the reason is that gfortran calls cpp
with the option "-traditional-cpp". In that case cpp writes:
write(*,*) #hello
g95 and NAG f95 do the same (i.e. produce an error) whereas the Intel
and the Sun Fortran Compiler produce the expected "hello".
Tobias