This is the mail archive of the gcc@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: h8300-elf build broken


> style nits: It should be size_t(__len - __pos), and not
> (size_t)(__len - __pos).  Same for the other hunk.  Patch OK with
> those changes.

Committed that way.  Thanks!  Ok for 4.7 branch as well?

	* include/bits/random.tcc (seed_seq::generate): Cast max()
	operands to size_t to ensure a template match.
	* include/std/bitset (_M_copy_from_ptr): Cast min() operands to
	size_t to ensure a template match.

Index: include/std/bitset
===================================================================
--- include/std/bitset	(revision 187375)
+++ include/std/bitset	(working copy)
@@ -1374,13 +1374,13 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
       void
       bitset<_Nb>::
       _M_copy_from_ptr(const _CharT* __s, size_t __len,
 		       size_t __pos, size_t __n, _CharT __zero, _CharT __one)
       {
 	reset();
-	const size_t __nbits = std::min(_Nb, std::min(__n, __len - __pos));
+	const size_t __nbits = std::min(_Nb, std::min(__n, size_t(__len - __pos)));
 	for (size_t __i = __nbits; __i > 0; --__i)
 	  {
 	    const _CharT __c = __s[__pos + __nbits - __i];
 	    if (_Traits::eq(__c, __zero))
 	      ;
 	    else if (_Traits::eq(__c, __one))
Index: include/bits/random.tcc
===================================================================
--- include/bits/random.tcc	(revision 187375)
+++ include/bits/random.tcc	(working copy)
@@ -2770,13 +2770,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 		       : (__n >=  68) ? 7
 		       : (__n >=  39) ? 5
 		       : (__n >=   7) ? 3
 		       : (__n - 1) / 2;
       const size_t __p = (__n - __t) / 2;
       const size_t __q = __p + __t;
-      const size_t __m = std::max(__s + 1, __n);
+      const size_t __m = std::max(size_t(__s + 1), __n);
 
       for (size_t __k = 0; __k < __m; ++__k)
 	{
 	  _Type __arg = (__begin[__k % __n]
 			 ^ __begin[(__k + __p) % __n]
 			 ^ __begin[(__k - 1) % __n]);


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