This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]