This is the mail archive of the
mailing list for the GCC project.
Re: g77 and cpp. Single quote in comment line.
- To: dbanks at cislunar dot com
- Subject: Re: g77 and cpp. Single quote in comment line.
- From: Craig Burley <burley at gnu dot org>
- Date: Sat, 19 Sep 1998 04:36:48 -0400 (EDT)
- Cc: egcs at cygnus dot com
- Cc: burley at gnu dot org
>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
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)