This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch, fortran] PR24174 real(10) and complex(10) array IO broken.
- From: FX Coudert <fxcoudert at gmail dot com>
- To: Janne Blomqvist <jblomqvi at cc dot hut dot fi>
- Cc: GNU GFortran <fortran at gcc dot gnu dot org>, GCC patches <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 05 Nov 2005 19:21:51 +0100
- Subject: Re: [Patch, fortran] PR24174 real(10) and complex(10) array IO broken.
- References: <20051011055737.GI3918@vipunen.hut.fi> <20051017210653.GL24358@vipunen.hut.fi> <43549090.2010609@gmail.com> <20051018175625.GM24358@vipunen.hut.fi> <20051025060922.GB28999@vipunen.hut.fi> <435E0DBE.5050409@gmail.com> <20051105163323.GE21942@vipunen.hut.fi>
Ok, here is an updated patch, fixing the above issue.
Most of the patch still looks ok. I'll look into it further tonight.
While I was at
it, I also made formatted complex(10) input work in addition to output
(i.e. fixing PR 24305 as well).
Nice!
I also made a couple of utility
functions for determining the size from the kind, and put them in
their own file.
I don't think we want to have a function call for that. The preprocessor
is your friend:
Index: libgfortran.h
===================================================================
--- libgfortran.h (revision 106521)
+++ libgfortran.h (working copy)
@@ -245,6 +245,12 @@
#define GFC_REAL_16_HUGE LDBL_MAX
#endif
+/* Macros for size of different types and kinds. */
+#define sizeof_logical_kind(k) sizeof(GFC_LOGICAL_ ## k)
+#define sizeof_integer_kind(k) sizeof(GFC_INTEGER_ ## k)
+#define sizeof_real_kind(k) sizeof(GFC_REAL_ ## k)
+#define sizeof_complex_kind(k) sizeof(GFC_COMPLEX_ ## k)
+
#ifndef GFC_MAX_DIMENSIONS
#define GFC_MAX_DIMENSIONS 7
#endif
However, there is still some kind of issue with formatted input of
very big real(10) numbers.
But AFAICS that has to do with parsing and
not with the padding issues that this patch tries to address, so I'll
file a separate PR for that.
OK, could you Cc: me in that PR when you file it?