This is the mail archive of the gcc-bugs@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]
Other format: [Raw text]

[Bug fortran/24965] Wrong file name in error message



------- Comment #5 from dfranke at gcc dot gnu dot org  2007-06-16 21:08 -------
Erik,
how did you prepare the attached file? I think I have an idea what's wrong:

Let there be "foo.inc", "bar.inc" and "pr24965.F90". The latter contains:

  #include "foo.inc"           ! integer :: foo
  #include "foo.inc"           ! integer :: foo
  #include "bar.inc"           ! integer :: bar
  end

Now running cpp and gfortran:
$> cpp-svn pr24965.F90 > pr24965.f90
$> gfortran-svn -g -Wall pr24965.f90
foo.inc:1.14:
    Included at pr24965.F90:2:

integer :: foo
             1
Error: Symbol 'foo' at (1) already has basic type of INTEGER

Which is the correct error message. The preprocessor lines in your file have
the format '# n "filename"' where n seems to be a line number. The lines
generated by my approach have the format '# n "filename" m' where m appears to
be a nesting level. Removing 'm' from any lines results in the reported
problem.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24965


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