From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.freebsd.org (mx2.freebsd.org [96.47.72.81]) by sourceware.org (Postfix) with ESMTPS id A48203947C3A for ; Wed, 19 May 2021 23:35:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org A48203947C3A Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=FreeBSD.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=jhb@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits)) (Client CN "mx1.freebsd.org", Issuer "R3" (verified OK)) by mx2.freebsd.org (Postfix) with ESMTPS id 6949FB36C5; Wed, 19 May 2021 23:35:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Flq3w2C2fz4kXm; Wed, 19 May 2021 23:35:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id CB4F022A63; Wed, 19 May 2021 23:35:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: [PATCH] Replace sort_tu_by_abbrev_offset with operator< To: Vaseeharan Vinayagamoorthy , Tom Tromey , "gdb-patches@sourceware.org" References: <20210515151915.990795-1-tom@tromey.com> <38657A42-8403-472B-B26B-B9F036D8BC87@arm.com> From: John Baldwin Message-ID: <11ab7e5d-5b36-fd4f-e52b-8e518e8eb9a0@FreeBSD.org> Date: Wed, 19 May 2021 16:35:19 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 MIME-Version: 1.0 In-Reply-To: <38657A42-8403-472B-B26B-B9F036D8BC87@arm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, NICE_REPLY_A, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 May 2021 23:35:25 -0000 On 5/19/21 3:22 PM, Vaseeharan Vinayagamoorthy via Gdb-patches wrote: > I am seeing this error: passing ‘const tu_abbrev_offset’ as ‘this’ argument of ‘bool tu_abbrev_offset::operator<(const tu_abbrev_offset&)’ discards qualifiers [-fpermissive] > > > In file included from /usr/include/c++/4.8.2/algorithm:62:0, > from /src/binutils-gdb--gdb/gdb/dwarf2/read.c:85: > /usr/include/c++/4.8.2/bits/stl_algo.h: In instantiation of ‘_RandomAccessIterator std::__unguarded_partition(_RandomAccessIterator, _RandomAccessIterator, const _Tp&) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Tp = tu_abbrev_offset]’: > /usr/include/c++/4.8.2/bits/stl_algo.h:2283:70: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >]’ > /usr/include/c++/4.8.2/bits/stl_algo.h:2315:54: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int]’ > /usr/include/c++/4.8.2/bits/stl_algo.h:5461:36: required from ‘void std::sort(_RAIter, _RAIter) [with _RAIter = __gnu_cxx::__normal_iterator >]’ > /src/binutils-gdb--gdb/gdb/dwarf2/read.c:7195:64: required from here > /usr/include/c++/4.8.2/bits/stl_algo.h:2245:19: error: passing ‘const tu_abbrev_offset’ as ‘this’ argument of ‘bool tu_abbrev_offset::operator<(const tu_abbrev_offset&)’ discards qualifiers [-fpermissive] > while (__pivot < *__last) I might have just pushed a fix for this. clang wasn't happy about the method not being const and this seems like it might be a variant of the same (the method being non-const might have had the effect of this error of removing const from 'this'). -- John Baldwin