From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id PDcfCk+PTWMS1A0AWB0awg (envelope-from ) for ; Mon, 17 Oct 2022 13:22:23 -0400 Received: by simark.ca (Postfix, from userid 112) id 1CD8D1E112; Mon, 17 Oct 2022 13:22:23 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=UO5WOf1d; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id B40551E0D3 for ; Mon, 17 Oct 2022 13:22:22 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 183D83858424 for ; Mon, 17 Oct 2022 17:22:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 183D83858424 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666027342; bh=x6yYLbIq4XKUDd9i4VkrgGjI/oSrE3un4x4FRcR9YNM=; h=To:Subject:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=UO5WOf1dBs9/BCj5hvzhTHfFMhcTkii11fE82o3BAAJjK0BE3YD50+Ph3TuJcjDKI IO4dQJUReHuYWM4ZWNLEVJUW0d60LajNBH+Km/vGXJV75i8Xgi2TiCkSpKk8dZ8vsP cp1MrdfO9noxulcG5HUDnLrGMPKBLbJyw9iZrAMU= Received: from mail-il1-x12b.google.com (mail-il1-x12b.google.com [IPv6:2607:f8b0:4864:20::12b]) by sourceware.org (Postfix) with ESMTPS id BF0D63858D32 for ; Mon, 17 Oct 2022 17:21:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BF0D63858D32 Received: by mail-il1-x12b.google.com with SMTP id a17so6186550ilq.1 for ; Mon, 17 Oct 2022 10:21:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=x6yYLbIq4XKUDd9i4VkrgGjI/oSrE3un4x4FRcR9YNM=; b=ZyKbfqxzGMAjMlED5EODk4YGf49Rd0Lu98Nrm3hKfKc4vE+EXK94yBNSpV2f/jO03c +F1Nf/UgfVeXVRPBrGMxt9X3UGD3pW8yh1u03OoEhvbB4xAURkXNe97Fr4X5IvhTD9UO QG1ZlfKBqZb9eo82hGmj35tnOdK+bpDfxy4FPKwTMOYGxu+EsxOOa8WwxcZiIK/VyVSu tCiiwFdYszunPRjwNHn3SE8CuEO7hsiKHH7HcYnI/B8WpsxafAi/4iXJU1xrBcySWhKV rAkxni9nA4x+v6BXkcFklA1pOBRNj0TVSQzkI9v4ziVApOyPB6WT/FNd722MyU6INtio LXgw== X-Gm-Message-State: ACrzQf2Dg2H80Heq/15P+SEUyrX7eqI9sdISZnp7QgimDArtW9rgX+tw FqfO1dr+kog9ftb986t6jpYXIA7QTsbPNA== X-Google-Smtp-Source: AMsMyM4o/7lp3P9WiND8KIpZ563hKP5jtJHCu93m9fGsSvjUiNbyARBCTSgDu3lVA5ySRiVdR5HaAQ== X-Received: by 2002:a05:6e02:1889:b0:2fc:3e4:9c5e with SMTP id o9-20020a056e02188900b002fc03e49c5emr5165262ilu.228.1666027313079; Mon, 17 Oct 2022 10:21:53 -0700 (PDT) Received: from murgatroyd (71-211-181-169.hlrn.qwest.net. [71.211.181.169]) by smtp.gmail.com with ESMTPSA id s18-20020a02cc92000000b00363ca583572sm118512jap.158.2022.10.17.10.21.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Oct 2022 10:21:52 -0700 (PDT) To: Pedro Alves Subject: Re: gmp's c++ interface / mpz_class References: X-Attribution: Tom Date: Mon, 17 Oct 2022 11:21:51 -0600 In-Reply-To: (Pedro Alves's message of "Fri, 14 Oct 2022 19:11:39 +0100") Message-ID: <87mt9ujrgw.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Tom Tromey via Gdb Reply-To: Tom Tromey Cc: gdb@sourceware.org, "Zaric, Zoran \(Zare\)" Errors-To: gdb-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb" >>>>> "Pedro" == Pedro Alves writes: Pedro> In gdb/gmp-utils.h. However, we need do to arithmetic on the type, and this wrapper Pedro> type doesn't implement operator+, operator-, etc, etc. I guess we could add those, Pedro> as wrappers around mpz_add, etc. Or use raw mpz_add, etc. directly. However, I just found Pedro> out that GMP already has its own C++ interface: Pedro> https://gmplib.org/manual/C_002b_002b-Interface-General Pedro> Before we explore this further, is there an already known reason we shouldn't be using Pedro> that interface? I feel sure Joel and I have talked about it, but I don't remember what reason there was any more. The warning in the manual is a bit off-putting, though: *Everything described in this chapter is to be considered preliminary and might be subject to incompatible changes if some unforeseen difficulty reveals itself.* Pedro> Not sure yet whether efficiency really matters in practice, but I suspect it does. I'm curious about this as well. FWIW I've occasionally thought about replacing parts of valarith with GMP. That way gdb could more easily support 128-bit integers. Tom