This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/22417] [4.0/4.1 Regression] gfortran preprocessing regression: nonsense warning about file left but not entered
- From: "jakub at redhat dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 Jul 2005 22:28:22 -0000
- Subject: [Bug fortran/22417] [4.0/4.1 Regression] gfortran preprocessing regression: nonsense warning about file left but not entered
- References: <20050711215026.22417.anlauf@hep.tu-darmstadt.de>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From jakub at redhat dot com 2005-07-11 22:28 -------
Oops. Untested patch, will do more testing tomorrow^Wtoday:
2005-07-12 Jakub Jelinek <jakub@redhat.com>
PR fortran/22417
* scanner.c (preprocessor_line): Fix file left but not entered
warning.
--- gcc/fortran/scanner.c.jj 2005-07-07 17:56:30.000000000 +0200
+++ gcc/fortran/scanner.c 2005-07-12 00:25:07.000000000 +0200
@@ -908,15 +908,15 @@ preprocessor_line (char *c)
if (flag[2]) /* Ending current file. */
{
- if (strcmp (current_file->filename, filename) != 0)
+ if (!current_file->up
+ || strcmp (current_file->up->filename, filename) != 0)
{
gfc_warning_now ("%s:%d: file %s left but not entered",
current_file->filename, current_file->line,
filename);
return;
}
- if (current_file->up)
- current_file = current_file->up;
+ current_file = current_file->up;
}
/* The name of the file can be a temporary file produced by
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22417