Commit 94b00ee4 by Jakub Jelinek Committed by Jakub Jelinek

re PR fortran/22417 (gfortran preprocessing regression: nonsense warning about…

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
parent 1c808565
2005-07-14 Jakub Jelinek <jakub@redhat.com>
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.
2005-07-14 Feng Wang <fengwang@nudt.edu.cn> 2005-07-14 Feng Wang <fengwang@nudt.edu.cn>
Steven G. Kargl <kargls@comcast.net> Steven G. Kargl <kargls@comcast.net>
......
...@@ -899,7 +899,7 @@ preprocessor_line (char *c) ...@@ -899,7 +899,7 @@ preprocessor_line (char *c)
/* Interpret flags. */ /* Interpret flags. */
if (flag[1] || flag[3]) /* Starting new file. */ if (flag[1]) /* Starting new file. */
{ {
f = get_file (filename, LC_RENAME); f = get_file (filename, LC_RENAME);
f->up = current_file; f->up = current_file;
...@@ -908,15 +908,15 @@ preprocessor_line (char *c) ...@@ -908,15 +908,15 @@ preprocessor_line (char *c)
if (flag[2]) /* Ending current file. */ 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", gfc_warning_now ("%s:%d: file %s left but not entered",
current_file->filename, current_file->line, current_file->filename, current_file->line,
filename); filename);
return; 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 /* The name of the file can be a temporary file produced by
......
2005-07-14 Jakub Jelinek <jakub@redhat.com>
PR fortran/22417
* gfortran.dg/g77/cpp5.F: New test.
* gfortran.dg/g77/cpp5.h: New file.
* gfortran.dg/g77/cpp5inc.h: New file.
2005-07-12 Paul Thomas <pault@gcc.gnu.org> 2005-07-12 Paul Thomas <pault@gcc.gnu.org>
PR libfortran/16435 PR libfortran/16435
......
! { dg-do run }
#include "cpp5.h"
IF (FOO().NE.1) CALL ABORT ()
END
FUNCTION FOO()
#include "cpp5inc.h"
END FUNCTION
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment