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

            Bug ID: 64517
           Summary: Inconsistent behavior when mixing -E and -M
           Product: gcc
           Version: 4.9.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: thfanning at gmail dot com

According to documentation, "Passing -M to the driver implies -E". However an
explicit `-E` produces different behavior.

  touch test.F90
  gfortran -M test.F90

produces:

  test.o: test.F90

However,

  gfortran -E -M test.F90

produces

  # 1 "test.F90"
  # 1 "<built-in>"
  # 1 "<command-line>"
  # 1 "test.F90"

  test.o: test.F90

As a result, preprocessor output is mixed with dependency output. A kludge is
to add `-o /dev/null`, but that is ugly.

The description for `-E` states: "The output is in the form of preprocessed
source code, which is sent to the standard output." But shouldn't `-M` change
*what* is sent to stdout?

Reply via email to