This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: -cpp and 'include'
On Mon, May 18, 2009 at 16:01, Daniel Franke <franke.daniel@gmail.com> wrote:
...
> To phrase it differently:
>
> ?(a) parse a fortran-file with fortran rules
> ?(b) middle-process the generated fortran-source by C-preprocessor rules
> ?(c) parse and process the resulting code by fortran rules again
>
> Yuk.
Agree--sounds nasty, huh? But couldn't it be simplified a little by
just integrating the include files and #include files before doing the
rest of the parsing?
> Do you know how COCO is supposed to handle include directives in this case?
From the ISO/IEC 1539-3 WORKING DRAFT para. 2.1:
<quote> Other lines (noncoco lines) are either copied unchanged to the
output, omitted, or converted to Fortran comments. There is no
requirement that the coco output is a valid Fortran program. The lines
of the coco output are in the same order as the corresponding lines
of the coco program. </quote>
So it seems to me that the include files are not read.
Regards,
-Tom