This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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]

[libstdc++] more operator precedence bugs


After noticing the one in open, I audited all uses of "ios_base::"
in include/bits/ and found two more.


r~


	* include/bits/fstream.tcc (basic_filebuf<>::open): Fix & ordering.
	* include/bits/ostream.tcc (basic_ostream<>::operator<<(long)): Same.
	(basic_ostream<>::operator<<(long long)): Same.

Index: fstream.tcc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/fstream.tcc,v
retrieving revision 1.27
diff -u -p -r1.27 fstream.tcc
--- fstream.tcc	9 Apr 2002 08:48:33 -0000	1.27
+++ fstream.tcc	12 Apr 2002 05:27:57 -0000
@@ -165,7 +165,7 @@ namespace std
 	      
 	      // For time being, set both (in/out) sets  of pointers.
 	      _M_set_indeterminate();
-	      if (__mode & ios_base::ate
+	      if ((__mode & ios_base::ate)
 		  && this->seekoff(0, ios_base::end, __mode) < 0)
 		this->close();
 	      __ret = this;
Index: ostream.tcc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/ostream.tcc,v
retrieving revision 1.26
diff -u -p -r1.26 ostream.tcc
--- ostream.tcc	9 Apr 2002 06:14:17 -0000	1.26
+++ ostream.tcc	12 Apr 2002 05:27:57 -0000
@@ -185,7 +185,7 @@ namespace std 
 	      if (_M_check_facet(_M_fnumput))
 		{
 		  bool __b = false;
-		  if (__fmt & ios_base::oct || __fmt & ios_base::hex)
+		  if ((__fmt & ios_base::oct) || (__fmt & ios_base::hex))
 		    {
 		      unsigned long __l = static_cast<unsigned long>(__n);
 		      __b = _M_fnumput->put(*this, *this, __c, __l).failed();
@@ -248,7 +248,7 @@ namespace std 
 	      if (_M_check_facet(_M_fnumput))
 		{
 		  bool __b = false;
-		  if (__fmt & ios_base::oct || __fmt & ios_base::hex)
+		  if ((__fmt & ios_base::oct) || (__fmt & ios_base::hex))
 		    {
 		      unsigned long long __l;
 		      __l = static_cast<unsigned long long>(__n);


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