This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/24965] Wrong file name in error message
- From: "dfranke at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 16 Jun 2007 21:08:37 -0000
- Subject: [Bug fortran/24965] Wrong file name in error message
- References: <bug-24965-7427@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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