[PATCH] eal: add asprintf() function for Windows
Thomas Monjalon
thomas at monjalon.net
Fri Jun 27 12:19:13 CEST 2025
12/06/2025 16:46, Andre Muezerie:
> On Thu, Jun 12, 2025 at 02:41:05AM +0200, Thomas Monjalon wrote:
> > 06/05/2025 03:43, Andre Muezerie:
> > > The asprintf function is not part of the C standard library but is a
> > > GNU extension commonly available in Unix-like systems. It dynamically
> > > allocates memory to store the formatted output string, similar to
> > > sprintf, but avoids buffer overflow issues by automatically sizing
> > > the buffer.
> > >
> > > Instead of rewriting it or coming up with some other replacement, this
> > > patch makes use of the implementation provided by Neved4.
> >
> > Why not using eal_asprintf()?
> >
>
> There are many calls being made directly to asprintf() which made me
> believe there wasn’t an equivalent available for Windows yet.
>
> Thanks for pointing out that is not the case.
>
> I’ll make the necessary changes to call eal_asprintf() instead.
Thanks to the define in lib/eal/common/eal_private.h,
asprintf should automatically call eal_asprintf on Windows.
More information about the dev
mailing list