This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] RISC-V: Improve li expansion for better code density.
- From: Kito Cheng <kito dot cheng at sifive dot com>
- To: Andreas Schwab <schwab at suse dot de>
- Cc: Binutils <binutils at sourceware dot org>, Kito Cheng <kito dot cheng at gmail dot com>, Jim Wilson <jimw at sifive dot com>
- Date: Thu, 22 Aug 2019 16:34:12 +0800
- Subject: Re: [PATCH] RISC-V: Improve li expansion for better code density.
- References: <1566456017-9152-1-git-send-email-kito.cheng@sifive.com> <mvm8srliq09.fsf@suse.de>
Hi Andreas:
Thanks, I was worry about that it might not provided by libc since it's not
in standard C,
but seems like libiberty has one, so I can use it without checking anything.
On Thu, Aug 22, 2019 at 4:05 PM Andreas Schwab <schwab@suse.de> wrote:
> On Aug 21 2019, Kito Cheng <kito.cheng@sifive.com> wrote:
>
> > + else
> > + {
> > + /* In case buf is not enough, malloc a large enough buffer
> > + and try again. */
> > + dynbuf_len = r + 1;
> > + dynbuf = (char *) xmalloc (dynbuf_len);
> > + r = vsnprintf (dynbuf, dynbuf_len, format, ap);
>
> You can use vasprintf instead.
>
> Andreas.
>
> --
> Andreas Schwab, SUSE Labs, schwab@suse.de
> GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
> "And now for something completely different."
>