From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 298EF3858C83 for ; Fri, 21 Apr 2023 13:13:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 298EF3858C83 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca Received: from [10.0.0.170] (unknown [167.248.160.41]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id A6EEF1E0D5; Fri, 21 Apr 2023 09:13:58 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1682082838; bh=yGQocphxFhDp4CiZ6Zy8IW2QSs+qHJS+01P/+q4M6d0=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=GDTN4bRb/E75hBYnmkUF11qGWdUHLcgeMU4XbF4CC7TQIgoez3aPClfAR/bxQ2daJ g1Zr96wHETpuZv28WUjna0yJyZnijhBHfK9vTeBgaZAWmq6MWKJ/3v3Per5MtME6p6 fJQ2gDohm40ZWWwu2zbCcVPettxcae3uited6JTk= Message-ID: Date: Fri, 21 Apr 2023 09:13:58 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH] Rewrite gdb_mpz::operator== To: Tom Tromey Cc: gdb-patches@sourceware.org References: <20230419150931.2047832-1-tromey@adacore.com> <119e1750-83c2-9e9f-a60a-3c14b2d6c09a@simark.ca> <875y9p2xvg.fsf@tromey.com> Content-Language: fr From: Simon Marchi In-Reply-To: <875y9p2xvg.fsf@tromey.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 4/21/23 09:00, Tom Tromey wrote: >>>>>> "Simon" == Simon Marchi writes: > > Simon> It's a bit hard to understand what the intent is, if you don't know the > Simon> problematic already. Could you add a comment explaining that? > > Sure. > > Simon> Also, wouldn't it work to compare size? Like: > Simon> if (sizeof (T) <= sizeof (long)) > > Yeah, though I was concerned that the compiler might emit warnings about > always-true conditions in this case. Well, that would be surprising for code in a template, where T is not know in advance. Simon