bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#12392: emacs-gtk misinterprets floating-point numbers under certain


From: Holger Arnold
Subject: bug#12392: emacs-gtk misinterprets floating-point numbers under certain locales on openSUSE 12.2
Date: Fri, 21 Sep 2012 22:08:02 +0200
User-agent: KMail/4.9.1 (Linux/3.5.4-1-default; KDE/4.9.1; i686; ; )

On Thursday 13 September 2012 at 01:20:29, Paul Eggert wrote:
> This particular problem looks like it's probably an OpenSUSE bug, but
> in general one cannot combine LC_NUMERIC=C with random encodings in
> LC_CTYPE.  It's safer if Emacs uses the C locale when parsing floating
> point numbers.  Here's a proposed patch to do that.  Can you apply
> this against the Emacs trunk and give it a try?

I have not yet had a chance to test these patches.  But is it really the 
correct approach to set the locale to "C" whenever a number literal is read or 
written and to set it back afterward?  (Btw., is setlocale() thread-safe?)  
Wouldn't it be simpler and more reliable to have number conversion functions 
that are independent of the current locale?

> +/* Cache for the C locale object.
> +   Marked volatile so that different threads see the same value
> +   (avoids locking).  */
> +static volatile locale_t c_locale_cache;

Maybe I'm missing something, but declaring a variable volatile does not 
automatically make it thread-safe, does it?

                Holger





reply via email to

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