[PATCH, libgfortran] PR 24685 IO for real(16)

Janne Blomqvist jblomqvi@cc.hut.fi
Wed Mar 15 16:16:00 GMT 2006


Hi,

could someone with access to hardware with 16 byte reals test this
patch and see if it fixes the problems reported in the PR?


2006-03-15  Janne Blomqvist  <jb@gcc.gnu.org>

	PR libgfortran/24685 
	* io/write.c (output_float): Use larger buffer for systems that
	support 16 byte reals.
	


-- 
Janne Blomqvist
-------------- next part --------------
Index: write.c
===================================================================
--- write.c	(revision 112084)
+++ write.c	(working copy)
@@ -377,7 +377,12 @@ static void
 output_float (st_parameter_dt *dtp, const fnode *f, GFC_REAL_LARGEST value)
 {
   /* This must be large enough to accurately hold any value.  */
-  char buffer[32];
+#ifdef HAVE_GFC_REAL_16
+  const int bufsize = 40;
+#else
+  const int bufsize = 32;
+#endif
+  char buffer[bufsize];
   char *out;
   char *digits;
   int e;
@@ -777,7 +782,7 @@ output_float (st_parameter_dt *dtp, cons
 	  edigits--;
 	}
 #if HAVE_SNPRINTF
-      snprintf (buffer, 32, "%+0*d", edigits, e);
+      snprintf (buffer, bufsize, "%+0*d", edigits, e);
 #else
       sprintf (buffer, "%+0*d", edigits, e);
 #endif
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 185 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20060315/50aeb5c4/attachment.sig>


More information about the Gcc-patches mailing list