This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
-cpp and 'include'
- From: Tom Browder <tom dot browder at gmail dot com>
- To: fortran at gcc dot gnu dot org
- Date: Sun, 17 May 2009 20:22:03 -0500
- Subject: -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