public inbox for libstdc++-cvs@sourceware.org help / color / mirror / Atom feed
From: Jonathan Wakely <redi@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r10-9565] libstdc++: Fix -Wsign-compare warnings Date: Mon, 29 Mar 2021 20:00:56 +0000 (GMT) [thread overview] Message-ID: <20210329200056.DB44F3851C3E@sourceware.org> (raw) https://gcc.gnu.org/g:ee978114fa542e7c584430fa643cfc9edda8039f commit r10-9565-gee978114fa542e7c584430fa643cfc9edda8039f 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. (cherry picked from commit 1d5589d11e61fa78b0c0e845728412b1cc6043d8) 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.
reply other threads:[~2021-03-29 20:00 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20210329200056.DB44F3851C3E@sourceware.org \ --to=redi@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ --cc=libstdc++-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).