[Bug fortran/22417] [4.0/4.1 Regression] gfortran preprocessing regression: nonsense warning about file left but not entered
jakub at redhat dot com
gcc-bugzilla@gcc.gnu.org
Mon Jul 11 23:09:00 GMT 2005
------- 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
More information about the Gcc-bugs
mailing list