This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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?



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]