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]

Fix libgfortran/io/write.c patch


My patch to io/write.c was wrong, I didn't notice that the
gfortran.dg/namelist_14.f90 were failing.  The problem is that
st_sprintf is not a fullblown sprintf implementation :-(

I've tested this patch on Linux/x86-64 and commit it (partly reverting
my previous patch),

Andreas

2005-05-15  Andreas Jaeger  <aj@suse.de>

	* io/write.c (nml_write_obj): Use %d again - and cast to int,
	st_sprintf does not handle %ld.


============================================================
Index: libgfortran/io/write.c
--- io/write.c	15 May 2005 12:49:40 -0000	1.35
+++ io/write.c	15 May 2005 15:19:36 -0000
@@ -1490,7 +1490,7 @@ nml_write_obj (namelist_info * obj, inde
 		{
 		  strcat (ext_name, dim_i ? "" : "(");
 		  clen = strlen (ext_name);
-		  st_sprintf (ext_name + clen, "%ld", (long) obj->ls[dim_i].idx);
+		  st_sprintf (ext_name + clen, "%d", (int) obj->ls[dim_i].idx);
 		  strcat (ext_name, (dim_i == obj->var_rank - 1) ? ")" : ",");
 		}
 

-- 
 Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj
  SUSE Linux Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
   GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126

Attachment: pgp00000.pgp
Description: PGP signature


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