https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92613

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |anlauf at gcc dot gnu.org

--- Comment #2 from anlauf at gcc dot gnu.org ---
(In reply to Christopher Albert from comment #1)
> Created attachment 62992 [details]
> Fix bogus warning with -cpp -fpreprocessed
> 
> This fixes the issue by skipping libcpp initialization and tokenization for
> normal compilations when both '-cpp' and '-fpreprocessed' are specified for
> Fortran code. Let me know if it works and what is your opinion on that.

A few comments:

- gfortran does preprocessing using cpp in the *traditional* mode, unlike
  several other brands that are Fortran-aware.

- Fortran comments can start with "!", but in fixed-form also with the
  corresponding comment character "c".

- The issue occurs with "'" as well as with '"'.

- How do you intend to have the testcase run?  With -cpp -E, or without -E?
  And what do you intend to test?
  (Compiling with -E lets it fail as is, and without -E it is silent.
  So what is the point of having the dg-bogus lines?)
  I just didn't get the point.

Other comments:

- I find the comments in the source file a little excessive.  Can you
  formulate more concisely?

+When compiling a file that has already been fully preprocessed by an

"fully" is not needed (what does it mean?)

+! This comment has a "quote" too { dg-bogus "missing terminating" }

That is really bogus.  Why should one ever get a warning at all?


Anyway, the patch is a good point to start the discussion with.
And I wonder if we should instead give a warning if someone combines
-cpp -fpreprocessed as contradicting options.
(Yes, I have seen the cmake issue).

Reply via email to