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 21:34:00 GMT 2009


Tim Prince schrieb am Mittwoch 10 Juni 2009 um 23:12:
> Steve Kargl wrote:
>
> >> ifort and sunf95 both take
> >>   -fpp
> >> to preprocess a source file while gfortran wants
> >>  -cpp
>
> .....
>
> >> No show stoppers at all, but inconvenient.
>
> -cpp[n]   same as -fpp[n]
>
> As most of us use the same pre-processing options for ifort and gfortran,
> we don't notice that others also exist.

Thank you, I wasn't aware of.

There is what sun has to say;
-F                    Apply the preprocessor to .F and .F90 files, but do not 
compile
-fpp                  Expands source code macros and enables conditional 
compilation of code
-ftrap=<t>[,<t>...]   Select floating-point trapping mode in effect at startup
-xpp[=<p>]            Select preprocessor; <p>={fpp|cpp}
Suffix 'S'            Assembler source for cpp


I guess I did choose -fpp because the intel and sun compiler were the ones I 
had to support first and its means the same to both.

However, I'm fine with the command switch.  I shouldn't have bring it up.  


As a mainly gcc using c++ coder and working with people who are intel and sun 
fortran users I was just a little stunned by the unfamiliar preprocessor 
behavior and wondered if this was just an oversight.  If you guys say it stays 
the way it is I fine with it.  I'll continue to use the workaround I choose 
right now
{{{
#ifdef __GNUC__
...
#else 
...
#endif
}}}

Thanks,
--Maik



More information about the Fortran mailing list