From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id og1UGsk2+WoBrQ4AWB0awg (envelope-from ) for ; Sat, 14 Nov 2026 23:36:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1794717385; bh=mthZm+VwIn+f3a7LGnfnKZ2z3SehG/fLYvtmfvwf0OU=; h=Date:Subject:From:To:References:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=f0YU/UYERJwBu5foY8CVORzlXD54nxkLOoZxGrzzFU0vsGQaESHX3B5JnL2HXmwcD VxncFOskTHWg5PGyo58HBvVjqc1TMkmudx4G/SO5AiZYdw5NpKwILt1ryxA9a9SLq4 iMed44wRDoHNlViXW1p1Va/fayx66EhGQ2mfkrKM= Received: by simark.ca (Postfix, from userid 112) id 464841E0BC; Sat, 14 Nov 2026 23:36:25 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=V9vXS2ha; dkim-atps=neutral Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id A67581E043 for ; Sat, 14 Nov 2026 23:36:24 -0500 (EST) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 316C84BA9014 for ; Sun, 15 Nov 2026 04:36:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 316C84BA9014 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=V9vXS2ha Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 2DE184BA23E9 for ; Sun, 15 Nov 2026 04:36:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2DE184BA23E9 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 2DE184BA23E9 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1794717361; cv=none; b=PusJdcJuN5HGYGf+OUP0q0WO7EUvumt5N8hXUPTC3nypYT/E6HAl2dyLR4M5inBSpRRiDC3yi9Ucu6KCMUhnc+fxl3avz5Ld2ZPiKt9ZuZbtSxGmzTWEliOYaGsEO/XJC5NY6l0OAj72UdlkN+uQsAq8odIBA0ny7cyO3pympSs= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1794717361; c=relaxed/simple; bh=mthZm+VwIn+f3a7LGnfnKZ2z3SehG/fLYvtmfvwf0OU=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:From:To; b=ehOhQNPX36PHwqY57+idgiJcTgmvk1lZ6YFY6f7I5Wzxcl6WnO6L+/1EVOLGm6/fo59a7CO+5XgKfwh5zvWqmyNCqunl6chgBOOGIrDDOLqIyDqW0+twjNvd0/zDHt2fZRk+SmAaDcXFcPYfmVk+bJA4ZHhEhBRzjrC8prjdmFo= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=V9vXS2ha DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2DE184BA23E9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1794717359; bh=mthZm+VwIn+f3a7LGnfnKZ2z3SehG/fLYvtmfvwf0OU=; h=Date:Subject:From:To:References:In-Reply-To:From; b=V9vXS2haoeCLAgMxkcJ6manRvMLLv4kP5KC02h474t9EMIX+7w/sUkEOO+88efKMi CqD2wxTNbCEALTIsdIKLZNqiPUrHyoK39yTqLEacmVHEDU17YPw6VMv/uijwNKIAT+ nYUpKnS2VfGT4H2RI2GgJCpX1jxoDeF0SOMx2jZo= Received: by simark.ca (Postfix) id 2DBB41E043; Sat, 14 Nov 2026 23:35:59 -0500 (EST) Message-ID: <5277869e-9484-43b6-8002-8e33819fb1e5@simark.ca> Date: Sat, 14 Nov 2026 23:35:58 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 09/15] Add gdb::make_span overload and add necessary calls From: Simon Marchi To: Tom Tromey , gdb-patches@sourceware.org References: <20261111-span-part-1-v2-0-cd4e33a8a723@adacore.com> <20261111-span-part-1-v2-9-cd4e33a8a723@adacore.com> <25416d4b-bf12-4183-b1ce-c085e386e6f4@simark.ca> Content-Language: en-US In-Reply-To: <25416d4b-bf12-4183-b1ce-c085e386e6f4@simark.ca> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org On 2026-11-14 22:53, Simon Marchi wrote: > > > On 2026-11-11 10:58, Tom Tromey wrote: >> Currently the gdb code relies on gdb::span having a single-object >> constructor and then making a span of 1 element from this object. >> This isn't part of C++20, so this patch adds a new gdb::make_span >> overload and then adds calls to this in various places as needed. >> >> I'm not completely sold on this particular overload. Perhaps it would >> be better to require make_span(&x, 1). > > Arguments for make_span(&x, 1): > > - makes the intent explicit > - easier transition to std::span(&x, 1) > > > Arguments for make_span(x): > > - shorter to write > > I think I'd lean towards make_span(&x, 1), since this is close to what > we'll have when we switch to always use std::span (assuming we don't > keep that one gdb::make_span overload). But really I wouldn't mind > either way. It appears that: std::vector v; gdb::make_span (v); creates a `gdb::span>` of length 1, which I think can be misleading. You'd probably notice because when trying to do anything with the resulting span, it wouldn't behave as a span, so you'd get some compilation error, but still confusing. That makes me lean further in favor of the explicit version. Simon