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 E8C76385840F for ; Mon, 22 Apr 2024 17:29:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E8C76385840F Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=FreeBSD.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=FreeBSD.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org E8C76385840F Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=96.47.72.81 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1713806957; cv=pass; b=duZUEI1aMJVK2Fpmrdbq+xHZQaEhlPZC8Xl9ukLdixR7D5AOZuY6foeTmSpeI0x6iEkVMzPeEdygwaxyS9Vx3fckWSLaLVWfV2xIOmelKStAF5ZdftnFxA9ugJfhWeEDTSZcA/1vfPKDOTkOv71eilPrK8Rr/dWV7yyco3aORlc= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1713806957; c=relaxed/simple; bh=Lr1bueJucZ5sNNx2uiaM67GUkRiCEkKObxcbch9d33w=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=gXXWYflTv+vzayhTWv0v7xIInG7NV6I730Dd7tCRY5O3wIkPvPKc8EnSd/WbMAexsAtFvr06BL++G8oYaGSjc2rD9txQU12S3XJcO8JLrP+E93N7MUbzYYLOxrZCu9OAxqKA/z8SrdTmeAlbo/Q4NUOKBFfNeVevPh0Le5OUsTU= ARC-Authentication-Results: i=2; server2.sourceware.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 4VNXL35mjDz3tfX; Mon, 22 Apr 2024 17:29:15 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 4VNXL350FVz4Rgy; Mon, 22 Apr 2024 17:29:15 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713806955; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qHmw6EGlauRKTd6I0gd2XyM/lQnKXEZ2rAOJoC8dNNU=; b=Y6ymE5MMBqkaY2460esXcv4wg/bfsXO2OPqHzjIe5HeUi53iXu5E9fmPYIHfGaFxptl2kG CiFIZAYU7JAyHTOBTOkggskgxKGAWfJZpT+GNEPbgO5q9jGq6/v6dvyOa8XBtJrxyoyV84 iXssvp29eKt3RI8MNW0novMLgZ0qHKvXQpMnV25r/yQr9YmqZ7d0eZY6OluGR8aCRhVVnp 2FlhgTH8TehL/0eZigzvAJptRLWnk4qb0mPwuE4aW+xi05U1SqfabZLkBjdRniNkJSYRxl cIphGACaBXcG0z/Iq6HTMY1jMFDriT/+op/JzgGCAn8R6zmzS7f4yQ4dzw4/DQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1713806955; a=rsa-sha256; cv=none; b=fJ9OksxELyuUcg6ejl4oDTomOtnM0iwHGmlYfUJnJh0lMf6xdgpIRx+6risfXelgCmLK10 GaleaF9knnBrzl3YU07vbtq4E8iE5gCpAbPhZmmVKbg3HohhRyWw7nsbFfAOsstpfI4OIY RLTcsXyJypALd+TseKkNgdBPLzGqo0M6iAS3qbusUDUWOCEAQsjuIWljghzR1Q+97mQoGJ tNwfA8Y32Ow9Qw7ooX0EEGqu37YKDMrtCkqmGgNFbzTO0GgwAhrn6Ka+8nu6vDg6eYKw5w z9mH46DHqvR00lbJoPNtJrvWRJT4pQiNFK9WKF6NWZ192BA8oTDoBnXAT2zJog== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713806955; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qHmw6EGlauRKTd6I0gd2XyM/lQnKXEZ2rAOJoC8dNNU=; b=ww4UqeA9ynKazfLxrnS0wOHXXBPg/wQKyv6oT3fEiU3usWM21aQxkji+U/F4C+wOotggPF hI2GDgmFSdf9oqROE9pAbgx7jmCck9wg2gsNZT2s4/iAm5Vapa+XPPD0+WxSY7U+izQwEH Kq3Fgzd9ZfLE4hPciYhvRZ7/0gNmnVFRF0npkbrOtPooa9IC7wKZ8kfRY3kra7LiCsesrS r+m2IzEqTSKIrYK7KM4LTlb8nEs94dwJHzAqEfqZlXY0Soj1d356CWp9/znYkG/gz83kwh seiIJa6uKBtjO3ymBMS3gD8lsE01o7N3nwzvQwXhpU85/BsVPV/9tRkqZXH37Q== Received: from [IPV6:2601:644:937f:4c50:48e:b274:3ff6:85b] (unknown [IPv6:2601:644:937f:4c50:48e:b274:3ff6:85b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4VNXL32hCLz1QYS; Mon, 22 Apr 2024 17:29:15 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <58c5e3fb-5768-4553-b61f-9a9b2616749e@FreeBSD.org> Date: Mon, 22 Apr 2024 10:29:14 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 08/10] Implement C++14 numeric separators Content-Language: en-US To: Tom Tromey , gdb-patches@sourceware.org References: <20240421-canon-fixes-v1-0-4dc4791d270d@tromey.com> <20240421-canon-fixes-v1-8-4dc4791d270d@tromey.com> From: John Baldwin In-Reply-To: <20240421-canon-fixes-v1-8-4dc4791d270d@tromey.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,TXREP 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/24 10:00 AM, Tom Tromey wrote: > C++14 allows the use of the apostrophe as a numeric separator; that > is, "23000" and "23'000" represent the same number. This patch > implements this for gdb's C++ parser and the C++ name canonicalizer. > > I did this unconditionally for all C variants because I think it's > unambiguous. > > For the name canonicalizer, there's at least one compiler that can > emit constants with this form, see bug 30845. I guess this is the only separator allowed so far? Longer term I do think it might be easier to understand the code if you always allocate a new string and copy valid characters into just using a 'continue' to skip characters you want to drop. Perhaps though this is a hot path where the extra allocation would be noticable? I also wonder if there might be benefit in a commit prior to this that pulls out the shared code here into a single routine that these files share? (Or is that not quite as doable with yacc?) -- John Baldwin