From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id A9B3A397248D for ; Thu, 10 Sep 2020 18:20:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org A9B3A397248D Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-373-43yrViAfPLuOoWOfXUEE9w-1; Thu, 10 Sep 2020 14:20:46 -0400 X-MC-Unique: 43yrViAfPLuOoWOfXUEE9w-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3C56664083; Thu, 10 Sep 2020 18:20:45 +0000 (UTC) Received: from localhost (unknown [10.33.37.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id DF03C19C78; Thu, 10 Sep 2020 18:20:44 +0000 (UTC) Date: Thu, 10 Sep 2020 19:20:44 +0100 From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed 5/5] libstdc++: Fix -Wsign-compare warnings Message-ID: <20200910182044.GK6061@redhat.com> References: <20200910181733.GA85317@redhat.com> MIME-Version: 1.0 In-Reply-To: <20200910181733.GA85317@redhat.com> X-Clacks-Overhead: GNU Terry Pratchett X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0.001 X-Mimecast-Originator: redhat.com Content-Type: multipart/mixed; boundary="GV0iVqYguTV4Q9ER" Content-Disposition: inline X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Sep 2020 18:20:49 -0000 --GV0iVqYguTV4Q9ER Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline * include/bits/locale_conv.h (__do_str_codecvt, __str_codecvt_in_all): Add casts to compare types of the same signedness. Tested powerpc64le-linux. Committed to trunk. --GV0iVqYguTV4Q9ER Content-Type: text/x-patch; charset=us-ascii Content-Disposition: attachment; filename="patch.txt" commit 1d5589d11e61fa78b0c0e845728412b1cc6043d8 Author: Jonathan Wakely Date: Thu Sep 10 18:57:39 2020 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 --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. --GV0iVqYguTV4Q9ER--