[gfortran] Fix PR 18869: multiple commons in a single line

Tobias Schlüter tobias.schlueter@physik.uni-muenchen.de
Tue Dec 7 19:58:00 GMT 2004


The testcase from PR 18869 looks like this:
  common /foo/ a, /bar/ b
  common /baz/ c /foobar/ d
  end

We didn't succeed in free form because we didn't eat the whitespace between
the commons correctly. Patch below, new testcase attached. bubblestrapped and
regtested. OK?

- Tobi

2004-12-07  Tobias Schlueter  <tobias.schlueter@physik.uni-muenchen.de>

	PR fortran/18869
	* match.c (gfc_match_common): Eat whitespace.

Index: match.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/match.c,v
retrieving revision 1.25
diff -u -p -r1.25 match.c
--- match.c     8 Nov 2004 14:56:39 -0000       1.25
+++ match.c     7 Dec 2004 19:50:19 -0000
@@ -2306,12 +2306,14 @@ gfc_match_common (void)
              as = NULL;
            }

+         gfc_gobble_whitespace ();
          if (gfc_match_eos () == MATCH_YES)
            goto done;
          if (gfc_peek_char () == '/')
            break;
          if (gfc_match_char (',') != MATCH_YES)
            goto syntax;
+         gfc_gobble_whitespace ();
          if (gfc_peek_char () == '/')
            break;
        }
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: common_1.f90
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20041207/84dec83b/attachment.f90>


More information about the Gcc-patches mailing list