Decimal values rounded on save

Linus Torvalds torvalds at
Mon Sep 3 11:24:57 PDT 2012

On Mon, Sep 3, 2012 at 11:13 AM, Linus Torvalds
<torvalds at> wrote:
> Damn. I guess we can do the usual
>         setlocale(LC_NUMERIC,"C");
> at the top of main(). Lazy, but the alternative is to do all the FP
> parsing by hand. We do *not* want the file to be locale-dependent.

Oh crist.

It's GTK. What a total piece of crap that library is.

The standard C rules are that the default locale is *always* the "C"
locale (exactly because nobody wants to have locales affect things
like parsing config files etc).

But gtk apparently does the

        setlocale(LC_ALL, "");

somewhere, which explains this braindamage.

And I can fix it, but then the sad part is that the gtk *visual* part
(where locales etc may well make sense!) will be broken.

Why the *hell* does GTK do LC_ALL? Using locale data for visual
elements is fine, but it is *not* fine to then mess things up and set
locales for the basic C library functions.


More information about the subsurface mailing list