[Bug fortran/67250] gfortran does not faithfully preprocess the way cpp does

kargl at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Aug 17 21:07:00 GMT 2015


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67250

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |kargl at gcc dot gnu.org
         Resolution|---                         |INVALID
           Severity|blocker                     |normal

--- Comment #5 from kargl at gcc dot gnu.org ---
See the documenation where it explicitly states:

   Many Fortran compilers including GNU Fortran allow passing
   the source code through a C preprocessor (CPP; sometimes
   also called the Fortran preprocessor, FPP) to allow for
   conditional compilation.  In the case of GNU Fortran, this
   is the GNU C Preprocessor in the traditional mode.

% ~/work/5/bin/cpp -I. -E -traditional-cpp u2.F

gives the same result as gfortran -I. -E u2.F.


Obvious workaround

cpp -I. -E file.F > file.f90
gfortran -c file.f90



More information about the Gcc-bugs mailing list