public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r11-3125] libstdc++: Fix -Wsign-compare warnings
@ 2020-09-10 18:17 Jonathan Wakely
  0 siblings, 0 replies; only message in thread
From: Jonathan Wakely @ 2020-09-10 18:17 UTC (permalink / raw)
  To: gcc-cvs, libstdc++-cvs

https://gcc.gnu.org/g:1d5589d11e61fa78b0c0e845728412b1cc6043d8

commit r11-3125-g1d5589d11e61fa78b0c0e845728412b1cc6043d8
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu Sep 10 18:57:39 2020 +0100

    libstdc++: Fix -Wsign-compare warnings
    
    libstdc++-v3/ChangeLog:
    
            * include/bits/locale_conv.h (__do_str_codecvt, __str_codecvt_in_all):
            Add casts to compare types of the same signedness.

Diff:
---
 libstdc++-v3/include/bits/locale_conv.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libstdc++-v3/include/bits/locale_conv.h b/libstdc++-v3/include/bits/locale_conv.h
index 4a11e237623..f1d7032e8bc 100644
--- a/libstdc++-v3/include/bits/locale_conv.h
+++ b/libstdc++-v3/include/bits/locale_conv.h
@@ -78,7 +78,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 	  __outchars = __outnext - &__outstr.front();
 	}
       while (__result == codecvt_base::partial && __next != __last
-	     && (__outstr.size() - __outchars) < __maxlen);
+	     && ptrdiff_t(__outstr.size() - __outchars) < __maxlen);
 
       if (__result == codecvt_base::error)
 	{
@@ -142,7 +142,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
       _State __state = {};
       size_t __n;
       return __str_codecvt_in(__first, __last, __outstr, __cvt, __state, __n)
-	&& (__n == (__last - __first));
+	&& (__n == size_t(__last - __first));
     }
 
   // Convert wide character string to narrow.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-09-10 18:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-10 18:17 [gcc r11-3125] libstdc++: Fix -Wsign-compare warnings Jonathan Wakely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).