[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: format is locale aware

From: Eric Blake
Subject: Re: format is locale aware
Date: Fri, 13 Jan 2023 15:40:55 -0600
User-agent: NeoMutt/20220429

On Tue, Jun 08, 2021 at 06:16:05PM +0200, Bruno Haible wrote:
> Hi Eric,
> > However, as previous versions of m4 were NOT locale-aware, enabling
> > locale support on what was supposed to be a minor release feels
> > awkward
> Yes; it can break some existing scripts that invoke m4.
> > > If no, the fix would be in main.c: Add a
> > >   setlocale (LC_NUMERIC, "C");
> > > after setlocale (LC_ALL, "").
> > 
> > Or to use gnulib c-strtod and c-vasnprintf modules.
> Well, c-strtod.c spends some time switching the locale. If the program
> does not contain any other uses of the LC_NUMERIC category of the locale
> (and this will also remain true in future versions of m4), it is more
> efficient to switch the LC_NUMERIC category to "C" once and for all.

I'm finally revisiting this thread, and decided to go with your
approach of forcing LC_NUMERIC instead of importing additional gnulib
modules, at least for the 1.4.x branch.

> c-vasnprintf, OTOH, is just as efficient as vasnprintf.
> Bruno

Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

reply via email to

[Prev in Thread] Current Thread [Next in Thread]