aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/scanner.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2005-07-14 09:15:00 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2005-07-14 09:15:00 +0200
commit94b00ee4e1126901db295a7223b3c6d7c5b1868d (patch)
tree13c40bee0e01dc6be30a1e076b1de7319d0344fd /gcc/fortran/scanner.c
parent1c80856534ddb0f084bb7cd049015c930b7d929f (diff)
downloadgcc-94b00ee4e1126901db295a7223b3c6d7c5b1868d.zip
gcc-94b00ee4e1126901db295a7223b3c6d7c5b1868d.tar.gz
gcc-94b00ee4e1126901db295a7223b3c6d7c5b1868d.tar.bz2
re PR fortran/22417 (gfortran preprocessing regression: nonsense warning about file left but not entered)
PR fortran/22417 * scanner.c (preprocessor_line): Don't treat flag 3 as the start of a new file. Fix file left but not entered warning. * gfortran.dg/g77/cpp5.F: New test. * gfortran.dg/g77/cpp5.h: New file. * gfortran.dg/g77/cpp5inc.h: New file. From-SVN: r102010
Diffstat (limited to 'gcc/fortran/scanner.c')
-rw-r--r--gcc/fortran/scanner.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/fortran/scanner.c b/gcc/fortran/scanner.c
index fe28820..eee3a68 100644
--- a/gcc/fortran/scanner.c
+++ b/gcc/fortran/scanner.c
@@ -899,7 +899,7 @@ preprocessor_line (char *c)
/* Interpret flags. */
- if (flag[1] || flag[3]) /* Starting new file. */
+ if (flag[1]) /* Starting new file. */
{
f = get_file (filename, LC_RENAME);
f->up = current_file;
@@ -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