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]

-cpp and 'include'


Is this correct behavior:

main.f:
----------

      program main
      include "include.inc"
      end

include.inc:
-------------

#if defined(BAH)
      integer g
#endif

compile:
------------
gfortran -cpp main.f -I. -o main

When I do that, I get errors:

Warning: include.inc:1: Illegal preprocessor directive
Warning: include.inc:3: Illegal preprocessor directive

It looks like the include is done before the cpp sees it, but then it
doesn't recognize the macros.

But if I change main.f to this:

main.f:
----------

      program main
#include "include.inc"
      end

It compiles with no errors.

Thanks,

-Tom


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