[Bug libgcc/100904] New: [9/10/11 Regression] Wrong line location #include error "No such file or directory" – line + 1 [traditional mode as used by gfortran]

burnus at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Jun 4 16:22:36 GMT 2021


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

            Bug ID: 100904
           Summary: [9/10/11 Regression] Wrong line location #include
                    error "No such file or directory" – line + 1
                    [traditional mode as used by gfortran]
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: libgcc
          Assignee: unassigned at gcc dot gnu.org
          Reporter: burnus at gcc dot gnu.org
  Target Milestone: ---

Working: GCC 6
Failing since: GCC 7

 * * *

echo '#include "nonExisting.h"' > file.c
echo '#include "nonExisting.h"' > file.F90

will give the wrong error location with:

  gfortran file.F90
or
  gcc -traditional-cpp file.c

Namely:
  file.c:2:2: fatal error: nonExisting.h: No such file or directory

Expected:
  Some line location in line 1.

  For instance, GCC 6 shows:

file.c:1:0: fatal error: nonExisting.h: No such file or directory
 #include "nonexisting.h"

 * * *

NOTE: gfortran only supports the traditional mode (as Fortran syntax and C
syntax does not mix well without additional cpp tweaking).

In C/C++, it works in non-traditional mode.


More information about the Gcc-bugs mailing list