[PATCH] Fix libio operator << with glibc 2.2

Jakub Jelinek jakub@redhat.com
Wed Oct 11 01:08:00 GMT 2000


Hi!

Without this libstdc++ v2 uses wrong padding character for floating values.
Ok to commit?

2000-10-11  Jakub Jelinek  <jakub@redhat.com>

	* iostream.cc (ostream::operator<<(double n)) [__GLIBC_MINOR__ >= 2]:
	Initialize new fields wide and i18n of struct printf_info.
	(ostream::operator<<(long double n)) [__GLIBC_MINOR__ >= 2]:
	Likewise.

--- gcc/libio/iostream.cc.jj	Wed May 24 09:06:07 2000
+++ gcc/libio/iostream.cc	Wed Oct 11 10:04:22 2000
@@ -1,5 +1,5 @@
 /* This is part of libio/iostream, providing -*- C++ -*- input/output.
-   Copyright (C) 1993, 1997 Free Software Foundation, Inc.
+   Copyright (C) 1993, 1997, 2000 Free Software Foundation, Inc.
 
    This file is part of the GNU IO Library.  This library is free
    software; you can redistribute it and/or modify it under the
@@ -687,6 +687,10 @@ ostream& ostream::operator<<(double n)
 				      /* extra: */ 0,
 #if __GLIBC_MINOR__ >= 1
 				      /* is_char: */ 0,
+#if __GLIBC_MINOR__ >= 2
+				      /* wide: */ 0,
+				      /* i18n: */ 0,
+#endif
 #endif
 #endif
 				      /* pad: */ fill()
@@ -793,6 +797,10 @@ ostream& ostream::operator<<(long double
 				  /* extra: */ 0,
 #if __GLIBC_MINOR__ >= 1
 				  /* is_char: */ 0,
+#if __GLIBC_MINOR__ >= 2
+				  /* wide: */ 0,
+				  /* i18n: */ 0,
+#endif
 #endif
 #endif
 				  /* pad: */ fill()

	Jakub


More information about the Gcc-patches mailing list