From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 897923858D20 for ; Wed, 17 Apr 2024 14:22:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 897923858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 897923858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713363722; cv=none; b=w34iTW5Y765StSwibBxv+wQ6qPVQlO8OG7K9o9tMH2Dpw6Py7fK7zrMdqpVnunKvB4ArM4zqdMNQK694RsjA9LFlA1imxzTybD08wXvd/YnkjRqNvq061adDw01RZipYKuRmHfZ9GV0RC8K7tEuB4jiba78u4tO2C08HsFIssNI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713363722; c=relaxed/simple; bh=CKuh5K+Ilg3EExvEvgpAiC21MrMb9iUPicAJHxFzhEg=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=tW7zZdyNkJbBodUo4NzpDM7/pohWJiVgLOgohre5LSkjoxdhQgF+TsuFfwkZhFmgPjtAyqDSXWSW479/PRS7sRedyW7H7ix/Kb5sX5IIfslgbge6+jPKlOtQGyLDqhsGvFEEz7/iEIu/iog4p+vYlOhx9M45W4v/k3gHxBtBrAU= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1713363721; 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=HGGjYOdPFLwmLTobz/xn9XCV7R2fuzxEdrRPr0WZ8dE=; b=M2Uwc0/xisEH9h7L5MS88on3j2RB0kpzJ5RbDgU9oq5mE5/Ydojfv9OUsAzFofgyTNxaIx /g0q6iTv0y83YpyxQaombbHxhFChq/NH4yIMnE6RBoblBHVztEQKxipxYeYL6o1QfmLbCf d9jvSBx00/EysPFYrtPXKuQcKbLw87s= Received: from mail-pf1-f197.google.com (mail-pf1-f197.google.com [209.85.210.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-14-i4LDn8BKM7OqqdIkWQb9Eg-1; Wed, 17 Apr 2024 10:21:59 -0400 X-MC-Unique: i4LDn8BKM7OqqdIkWQb9Eg-1 Received: by mail-pf1-f197.google.com with SMTP id d2e1a72fcca58-6edff450718so3749866b3a.0 for ; Wed, 17 Apr 2024 07:21:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713363718; x=1713968518; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=HGGjYOdPFLwmLTobz/xn9XCV7R2fuzxEdrRPr0WZ8dE=; b=Fx8X1iEZZbCZ85aVK8UgqHeNrjiEkRyNWdmrjO6F8nmtBd6efE9WQ6ua4//cHZ7Wik owyk5K61/iDKr3m8G13MbAzfP9Fmag8S5178T0DRWMQCFM7s2gNFeDPISDTR97LcEeZR EkspPMaWzPcWN/cvVDh6gVFv6ApMJ+hoXBmpzyOTBc49f2NqaqBlkl53PRdAQJ5HLHZr Xgzp8q15R/74HabFk8uCoOu9Vzl3scBy6Y18zWira/edswHfheiP3scMNdiguSSOcQbN WlJKZEVJclC5cMdwkiz0DkFQGNdCkFfsDyK8T+hgJ3PAcl0Rdq53ZYuGAkACiH7r4oWl sm6A== X-Forwarded-Encrypted: i=1; AJvYcCWjB/j9FH2I/dOJYPqI1qKaGkJZAV0N90yWzxQ0Xeeh37quRQ7oBL0g/zUO/rHk/82LcdUHLzQLJsZjhcO302lxZzPIVNOLfs+0bw== X-Gm-Message-State: AOJu0YxVwGWOHXzYspsfjLg9WZaWN5VJpn56M/snQWlO4yUdprokGehI QHcprXeGEwK3hewVwx5pfupPDbKx7zmjYLW8WnOIL0mDxneLzhQzr8oL6vVgxw5AV5T/aJucd0I r95DtGAUTjtkWntz791AOMkpuhzhGyvQuCZvwaOHjfETgLXUB1JIHfJtv2iE/XMtW6HM= X-Received: by 2002:a05:6a00:4f84:b0:6e6:9c79:87e9 with SMTP id ld4-20020a056a004f8400b006e69c7987e9mr19808604pfb.34.1713363718496; Wed, 17 Apr 2024 07:21:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFoGR0n7LYzjESxVrPZ6lxjuhfNA/xnGngAEKAwA9CiZkuWYih5SRdjNPLWOTkjo9A3sNiVmw== X-Received: by 2002:a05:6a00:4f84:b0:6e6:9c79:87e9 with SMTP id ld4-20020a056a004f8400b006e69c7987e9mr19808566pfb.34.1713363718086; Wed, 17 Apr 2024 07:21:58 -0700 (PDT) Received: from [150.1.200.12] ([71.212.146.31]) by smtp.gmail.com with ESMTPSA id r10-20020a056a00216a00b006eae3aac040sm10703864pff.31.2024.04.17.07.21.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 17 Apr 2024 07:21:57 -0700 (PDT) Message-ID: <3f50a413-6be8-410a-a518-11764595921b@redhat.com> Date: Wed, 17 Apr 2024 07:21:57 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] Remove a copy from c-exp.y:parse_number To: Tom Tromey , gdb-patches@sourceware.org References: <20240417070145.1013104-1-tom@tromey.com> From: Keith Seitz In-Reply-To: <20240417070145.1013104-1-tom@tromey.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,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/17/24 00:01, Tom Tromey wrote: > parse_number copies its input string, but there is no need to do this. > This patch removes the copy. > > Regression tested on x86-64 Fedora 38. Out of curiosity, I did a little digging into this, well, curiosity... I committed that over a decade ago, and my notes mention some of the difficulties with generic parser constification I was having at the time, including having to fudge several places with alloca. So if there was a reason for it back then, it was a hack, and it is now obviously long gone. Reviewed-by: Keith Seitz Thank you, Keith