aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2020-09-10 18:57:39 +0100
committerJonathan Wakely <jwakely@redhat.com>2020-09-10 18:57:39 +0100
commit1d5589d11e61fa78b0c0e845728412b1cc6043d8 (patch)
treefff06992e18a7af1940f8f108e0f199e24dc4831
parent866c53cb2e88e172476185327723df9197c34ae7 (diff)
downloadgcc-1d5589d11e61fa78b0c0e845728412b1cc6043d8.zip
gcc-1d5589d11e61fa78b0c0e845728412b1cc6043d8.tar.gz
gcc-1d5589d11e61fa78b0c0e845728412b1cc6043d8.tar.bz2
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.
-rw-r--r--libstdc++-v3/include/bits/locale_conv.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/libstdc++-v3/include/bits/locale_conv.h b/libstdc++-v3/include/bits/locale_conv.h
index 4a11e23..f1d7032 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.