From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 123644 invoked by alias); 25 Oct 2017 13:35:38 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 123629 invoked by uid 89); 25 Oct 2017 13:35:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:851, forgot X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0a-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.156.1) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 25 Oct 2017 13:35:31 +0000 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v9PDWRDh124620 for ; Wed, 25 Oct 2017 09:35:30 -0400 Received: from e06smtp14.uk.ibm.com (e06smtp14.uk.ibm.com [195.75.94.110]) by mx0a-001b2d01.pphosted.com with ESMTP id 2dttk7kmnd-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 25 Oct 2017 09:35:29 -0400 Received: from localhost by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 25 Oct 2017 14:35:27 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp14.uk.ibm.com (192.168.101.144) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 25 Oct 2017 14:35:25 +0100 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v9PDZPSu27656414; Wed, 25 Oct 2017 13:35:25 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E79E2AE04D; Wed, 25 Oct 2017 14:29:20 +0100 (BST) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D7C50AE045; Wed, 25 Oct 2017 14:29:20 +0100 (BST) Received: from oc3748833570.ibm.com (unknown [9.152.213.178]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 25 Oct 2017 14:29:20 +0100 (BST) Received: by oc3748833570.ibm.com (Postfix, from userid 1000) id AB565D807F1; Wed, 25 Oct 2017 15:35:24 +0200 (CEST) Subject: [pushed] Re: [RFC][08/19] Target FP: Use target format throughout expression parsing To: simark@simark.ca (Simon Marchi) Date: Wed, 25 Oct 2017 13:35:00 -0000 From: "Ulrich Weigand" Cc: brobecker@adacore.com (Joel Brobecker), gdb-patches@sourceware.org In-Reply-To: from "Simon Marchi" at Oct 09, 2017 05:14:53 PM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 17102513-0016-0000-0000-000004F9BE34 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17102513-0017-0000-0000-000028353409 Message-Id: <20171025133524.AB565D807F1@oc3748833570.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-10-25_08:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1710250185 X-SW-Source: 2017-10/txt/msg00766.txt.bz2 > On 2017-10-09 02:12 PM, Joel Brobecker wrote: > > One C++ thing I did notice but forgot to report... > > > >> +floatformat_from_string (const struct floatformat *fmt, gdb_byte *out, > >> + std::string in) > > > > Again, to be double-checked, but I think you want to pass the argument > > by reference in this case. Otherwise, you may end up having an overhead > > with might not be necessary due to the creation of a copy of the string > > being passed as argument here. > > > > Indeed, it's good practice to pass constant strings (or other objects) as > const references (const std::string &in). I've now pushed this patch (using the const reference as suggested). Bye, Ulrich -- Dr. Ulrich Weigand GNU/Linux compilers and toolchain Ulrich.Weigand@de.ibm.com