This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[gfortran] Fixes for p and : format descriptors
- From: Tobias Schlüter <tobias dot schlueter at physik dot uni-muenchen dot de>
- To: GCC Fortran mailing list <fortran at gcc dot gnu dot org>,patch <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 06 May 2004 23:51:48 +0200
- Subject: [gfortran] Fixes for p and : format descriptors
Hi,
The I/O-library wrongly enforced a comma after a P edit descriptor. The
following is completely valid and accepted by the frontend:
WRITE(*,100) x; 100 FORMAT(1pf5.2)
This one-liner fixes this. And as you can see from my change to the
first line, I don't believe it's copyrightable.
2004-05-06 Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de>
* io/format.c: Adjust copyright years to fit coding convention.
(parse_format_list): No comma is required after P descriptor.
- Tobi
Index: format.c
===================================================================
RCS file: /cvsroot/gcc/gcc/libgfortran/io/Attic/format.c,v
retrieving revision 1.1.2.4
diff -u -p -r1.1.2.4 format.c
--- format.c 23 Apr 2004 01:43:16 -0000 1.1.2.4
+++ format.c 6 May 2004 21:10:06 -0000
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2003 Free Software Foundation, Inc.
+/* Copyright (C) 2002,2003 Free Software Foundation, Inc.
Contributed by Andy Vaught
This file is part of the GNU Fortran 95 runtime library (libgfortran).
@@ -510,7 +510,7 @@ format_item:
}
saved_token = t;
- goto between_desc;
+ goto optional_comma;
case FMT_P: /* P and X require a prior number */
error = "P descriptor requires leading scale factor";