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: Janne Blomqvist <jblomqvi at cc dot hut dot fi>
- To: FX Coudert <fxcoudert at gmail dot com>
- Cc: GNU GFortran <fortran at gcc dot gnu dot org>, GCC patches <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 5 Nov 2005 21:51:11 +0200
- 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> <436CF83F.3020102@gmail.com>
On Sat, Nov 05, 2005 at 07:21:51PM +0100, FX Coudert wrote:
> >Ok, here is an updated patch, fixing the above issue.
>
> Most of the patch still looks ok. I'll look into it further tonight.
Thanks!
> >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
> #endi
Uh, that's some nice cpp magic, but uh, it won't work unless k is a
compile-time constant. So it won't help me here.
> >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?
This is now PR 24685.
PS: I got my write-after-approval access tonight, so hopefully I'll be
able to commit this myself once it's OK:d.
--
Janne Blomqvist