[Bug libfortran/53051] New: I/O: Support reading floating-point numbers which use "Q" for the exponent
burnus at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Apr 19 21:34:00 GMT 2012
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53051
Bug #: 53051
Summary: I/O: Support reading floating-point numbers which use
"Q" for the exponent
Classification: Unclassified
Product: gcc
Version: 4.8.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libfortran
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: burnus@gcc.gnu.org
CC: jvdelisle@gcc.gnu.org
gfortran supports since GCC 4.6 quadprecision on common hardware. Thus, users
started to expect that "q" works for the exponents, e.g., 4.0q0. (The "q" is a
vendor extension.)
In 4.7, the "q" became supported in the source code (with -Wreal-q-constant as
warning). Well, it seems as if we should to also support "q" in the library.
Cf. https://groups.google.com/forum/#!topic/comp.lang.fortran/rfDXj9VQRZM
Untested draft patch below.
--- a/libgfortran/io/list_read.c
+++ b/libgfortran/io/list_read.c
@@ -1138,2 +1138,4 @@ parse_real (st_parameter_dt *dtp, void *buffer, int
length)
case 'D':
+ case 'q':
+ case 'Q':
push_char (dtp, 'e');
@@ -1451,2 +1453,4 @@ read_real (st_parameter_dt *dtp, void * dest, int length)
case 'd':
+ case 'Q':
+ case 'q':
goto exp1;
@@ -1548,2 +1552,4 @@ read_real (st_parameter_dt *dtp, void * dest, int length)
case 'd':
+ case 'Q'
+ case 'q':
goto exp1;
diff --git a/libgfortran/io/read.c b/libgfortran/io/read.c
index aa41bc7..32c8b32 100644
--- a/libgfortran/io/read.c
+++ b/libgfortran/io/read.c
@@ -1028,2 +1028,4 @@ found_digit:
case 'D':
+ case 'q':
+ case 'Q':
++p;
More information about the Gcc-bugs
mailing list