Re: [PATCH] test-inspect: reset locale after gtk_init()

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

 



On Sun, Jul 05, 2020 at 12:12:55PM -0700, Linus Torvalds wrote:
> On Sun, Jul 5, 2020 at 11:51 AM Davidson Francis <davidsondfgl@xxxxxxxxx> wrote:
> >
> > The test-inspect tool uses GTK to visualize symbol nodes. It turns
> > out that gtk_init() implicitly sets the locale to the system locale,
> > and since Sparse uses strtod()/strtold() for parsing floating-point
> > numbers in expressions, parsing becomes locale-dependent.

Oh yes, indeed :(
Thanks for the patch.
 
> We probably shouldn't be using strtod/strtold in the first place
> because of issues like this, but I think your patch is likely the
> simplest fix.

Yes. 
 
> It _might_ be a good idea to limit it to LC_NUMERIC instead of LC_ALL,
> but who knows.. I'm not sure what else might be affected (and I'm not
> sure how good LC_NUMERIC support is on all platforms)

Well, checking the standard, I see that strtold() first strips
whitespaces as defined by isspace() and isspace() itself depends
on LC_CTYPE. So, for the moment, I prefer to take Davidson's
patch as is this (OTOH, we already depend on isspace() anyway).

-- Luc



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux