This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Small patch to enable build of gdb-7.6 for GNU/Hurd
- From: Svante Signell <svante dot signell at gmail dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: Joel Brobecker <brobecker at adacore dot com>, Sergio Durigan Junior <sergiodj at redhat dot com>, gdb-patches at sourceware dot org
- Date: Fri, 24 May 2013 11:07:26 +0200
- Subject: Re: Small patch to enable build of gdb-7.6 for GNU/Hurd
- References: <1369326967 dot 8127 dot 33 dot camel at s1499 dot it dot kth dot se> <m3mwrlm6al dot fsf at redhat dot com> <20130524042734 dot GG4017 at adacore dot com> <519F2A7A dot 4050002 at redhat dot com>
On Fri, 2013-05-24 at 09:53 +0100, Pedro Alves wrote:
> On 05/24/2013 05:27 AM, Joel Brobecker wrote:
> > On Thu, May 23, 2013 at 11:59:46PM -0300, Sergio Durigan Junior wrote:
> >> Thanks for your patch, Svante.
> >>
> >> On Thursday, May 23 2013, Svante Signell wrote:
> >>
...
> > And quite honestly, I find this use of a macro in the middle of
> > a function quite ugly and unnecessary, no matter what was done
> > before. My preference mirrors Tom's suggestion, but failing that,
> > I'd rather FMT be a const char * or a const char [].
>
> Agreed.
>
> const char fmt[] = "..." is better than 'const char *', as the
> latter gives you an unnecessary extra pointer.
>
> Make that 'static const char fmt[] = "...";' even.
>
> But really alloca for potentially large/unbounded buffers is evil.
> xstrprintf plus a cleanup would definitely be my preference.
I will change to use xstrprintf instead. Updated patch with ChangeLog
entry will follow shortly. Is it OK to modify also the other (preceding)
function in the same way (for consistency)?