This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


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

Re: g77 and cpp. Single quote in comment line.


>I've had a long term problem with code that uses cpp with g77 
>and has single quotes in comment lines. What seems to be happenning
>is that when someone puts a contracted word in a comment line the 
>preprocessor chokes. Several external codes that I've long used
>on the HP, SGI, and Cray systems never had a problem with this but
>since I've been using Linux this comes up all the time for me.
>Is there something that can be done about it at the EGCS level?

The problem is generally that g77 offers only cpp-style preprocessing
at this time, which means that the preprocessing language is pretty
much C-like, rather than Fortran-like.

And, C-like preprocessing means that a comment line beginning with
the letter `C' in column one doesn't look like a comment line to
the preprocessor.  Since the preprocessor also has to know about
C-style character constants (which look somewhat like Fortran-style
character constants), it therefore complains about unterminated
apostrophes, as well as double quotes, `/*', and so on.

A stopgap fix might be to teach the gcc cpp preprocessor (cccp.c)
about Fortran comment styles and enable these styles via command-line
options which, in turn, g77 can automatically provide when it invokes
the preprocessor.

In the long run, it'd be great to offer a Fortran-specific preprocessor
with g77.  There are apparently some Fortran preprocessors available
on the 'net, but I haven't investigated these.

        tq vm, (burley)


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