preprocessor token "#" doesn't work in gfortran as in gcc, intel-fortran or sun-fortran compiler

Maik Beckmann beckmann.maik@googlemail.com
Wed Jun 10 20:29:00 GMT 2009


Tim Prince schrieb am Mittwoch 10 Juni 2009 um 19:57:
> Maik Beckmann wrote:
> >
> > Is there a command line switch to force gfortran to use the current gcc
> > cpp?
>
> I haven't heard of any such thing.  Why would anyone support it?  You
> could simply use the gcc pre-processing without -traditional, if you don't
> care about breaking Fortran string concatenation.

If all compilers would behave behave the same way it wouldn't an issue.  But 
having to maintain something just for gfortran is just inconvenient.

ifort and sunf95 both take 
  -fpp
to preprocess a source file while gfortran wants 
 -cpp
ifort and sunf95 both use the standard cpp 
  #define TO_STR(EXPR) #EXPR
while gfortran wants
  #define TO_STR(EXPR) "EXPR"

No show stoppers at all, but inconvenient.

Thanks,
 --Maik



More information about the Fortran mailing list