This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[pushed] Re: [RFC][08/19] Target FP: Use target format throughout expression parsing
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: simark at simark dot ca (Simon Marchi)
- Cc: brobecker at adacore dot com (Joel Brobecker), gdb-patches at sourceware dot org
- Date: Wed, 25 Oct 2017 15:35:24 +0200 (CEST)
- Subject: [pushed] Re: [RFC][08/19] Target FP: Use target format throughout expression parsing
- Authentication-results: sourceware.org; auth=none
> 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