From: Linus Torvalds <torvalds@linux-foundation.org>
To: Davidson Francis <davidsondfgl@gmail.com>
Cc: Sparse Mailing-list <linux-sparse@vger.kernel.org>
Subject: Re: [PATCH] test-inspect: reset locale after gtk_init()
Date: Sun, 5 Jul 2020 12:12:55 -0700 [thread overview]
Message-ID: <CAHk-=wjqh1KOVWaP=xPZH_9grwDVtCMitWOb4vtKj+cB0jghBw@mail.gmail.com> (raw)
In-Reply-To: <20200705185013.8578-1-davidsondfgl@gmail.com>
On Sun, Jul 5, 2020 at 11:51 AM Davidson Francis <davidsondfgl@gmail.com> 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.
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.
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)
Linus
next prev parent reply other threads:[~2020-07-05 19:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-05 18:50 [PATCH] test-inspect: reset locale after gtk_init() Davidson Francis
2020-07-05 19:12 ` Linus Torvalds [this message]
2020-07-05 20:35 ` Luc Van Oostenryck
2020-07-05 23:28 ` Davidson Francis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAHk-=wjqh1KOVWaP=xPZH_9grwDVtCMitWOb4vtKj+cB0jghBw@mail.gmail.com' \
--to=torvalds@linux-foundation.org \
--cc=davidsondfgl@gmail.com \
--cc=linux-sparse@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).