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

Tobias Schlüter tobias.schlueter@physik.uni-muenchen.de
Wed Jun 10 16:23:00 GMT 2009


Hi,

Maik Beckmann wrote:
> Why does gfortran -cpp" behave different than gcc or any other fortran compiler 
> I have around?  Is this by intention or just a bug?

gfortran's preprocessor uses traditional C preprocessing rules, which 
differ from what was standardized in C90 in regards to token pasting and 
stringification.  There may be a command line option to change this 
behavior (I don't know), and it may make sense to revise that decision 
if all other compilers behave differently.

Cheers,
- Tobi



More information about the Fortran mailing list