[Patch, fortran] PR24174 real(10) and complex(10) array IO broken.

Janne Blomqvist jblomqvi@cc.hut.fi
Sat Nov 5 19:52:00 GMT 2005


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



More information about the Gcc-patches mailing list