From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id BFFA83972453; Thu, 10 Sep 2020 18:17:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BFFA83972453 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1599761824; bh=LDWf2mxqML5+7soV/9iop74G1yrV32vFwib+KZYD1gc=; h=From:To:Subject:Date:From; b=fcmEve92qVgSTUtOQbf5ora8XPq2uZXNFSL3VAtLNP0ZOfMe0QYn75ECu4JJQhCxF LRyqwEyTQ+vo2O9xgzzVGoNU3TiishaOlP71rtPiWUThEYvjlIf6FPAPhm6NKumTCL gJ54SZOcpX6RLRsipP7ViFQHrgXS0cn4MkaifZVo= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Jonathan Wakely To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r11-3125] libstdc++: Fix -Wsign-compare warnings X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/master X-Git-Oldrev: 866c53cb2e88e172476185327723df9197c34ae7 X-Git-Newrev: 1d5589d11e61fa78b0c0e845728412b1cc6043d8 Message-Id: <20200910181704.BFFA83972453@sourceware.org> Date: Thu, 10 Sep 2020 18:17:04 +0000 (GMT) X-BeenThere: libstdc++-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Sep 2020 18:17:04 -0000 https://gcc.gnu.org/g:1d5589d11e61fa78b0c0e845728412b1cc6043d8 commit r11-3125-g1d5589d11e61fa78b0c0e845728412b1cc6043d8 Author: Jonathan Wakely 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.