From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Holger Arnold Newsgroups: gmane.emacs.bugs 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 Message-ID: <3280435.OyV9o2Zt6I@thinkpad.home> References: <87r4qbodec.fsf@Rainer.invalid> <5051974D.2020106@cs.ucla.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit X-Trace: ger.gmane.org 1348258168 3161 80.91.229.3 (21 Sep 2012 20:09:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 21 Sep 2012 20:09:28 +0000 (UTC) To: 12392@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Sep 21 22:09:33 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TF9XX-00009J-SD for geb-bug-gnu-emacs@m.gmane.org; Fri, 21 Sep 2012 22:09:32 +0200 Original-Received: from localhost ([::1]:60383 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TF9XT-0002T7-38 for geb-bug-gnu-emacs@m.gmane.org; Fri, 21 Sep 2012 16:09:27 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:55928) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TF9XQ-0002T0-Lg for bug-gnu-emacs@gnu.org; Fri, 21 Sep 2012 16:09:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TF9XP-0004EZ-Fd for bug-gnu-emacs@gnu.org; Fri, 21 Sep 2012 16:09:24 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:37993) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TF9XP-0004EV-CE for bug-gnu-emacs@gnu.org; Fri, 21 Sep 2012 16:09:23 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TF9Yz-0002T3-L9 for bug-gnu-emacs@gnu.org; Fri, 21 Sep 2012 16:11:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Holger Arnold Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 21 Sep 2012 20:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12392 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.13482582099424 (code B ref -1); Fri, 21 Sep 2012 20:11:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 21 Sep 2012 20:10:09 +0000 Original-Received: from localhost ([127.0.0.1]:47539 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TF9Y9-0002Rx-26 for submit@debbugs.gnu.org; Fri, 21 Sep 2012 16:10:09 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:50903) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TF9Y6-0002Rp-CF for submit@debbugs.gnu.org; Fri, 21 Sep 2012 16:10:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TF9WU-0003uZ-PP for submit@debbugs.gnu.org; Fri, 21 Sep 2012 16:08:27 -0400 Original-Received: from lists.gnu.org ([208.118.235.17]:41643) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TF9WU-0003uV-M4 for submit@debbugs.gnu.org; Fri, 21 Sep 2012 16:08:26 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:55119) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TF9WT-0002LM-OR for bug-gnu-emacs@gnu.org; Fri, 21 Sep 2012 16:08:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TF9WS-0003uB-NL for bug-gnu-emacs@gnu.org; Fri, 21 Sep 2012 16:08:25 -0400 Original-Received: from mail-bk0-f41.google.com ([209.85.214.41]:39456) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TF9WS-0003u3-GR for bug-gnu-emacs@gnu.org; Fri, 21 Sep 2012 16:08:24 -0400 Original-Received: by bkcjc3 with SMTP id jc3so1785290bkc.0 for ; Fri, 21 Sep 2012 13:08:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:user-agent:in-reply-to:references :mime-version:content-transfer-encoding:content-type; bh=jSXGMND2Qtr/dlIy7CxbZNuvh6UD/99iEmg32Wyw/ag=; b=vk2SPc+n1eV4r3iEUu83eKEc1BStX4tcy/iTs5K+xFRgyaljRlfqema89yBcC+ppTA gC6DBHdvYV3IZ8tURh6ygBFG+/WR4xh31la+96ypxP6iF8SECP/44LUYX9GNUQ4KjhMr m87xJB7bO8TllH0VwD49sx9tCfXcJJl9UlbdLm/sA5gEnQpvYPraM58+FELMhFoZprG8 nKLww00LeqKP7EiuHy8RWmQitFeFP4mMIF+IxjF27Cq4/o3Ue/LKAmsD0oQEy521nd5t 4XQZHrBIGX67ClF0PY7H+Zxz859kXBifF1eHyESa+d5EzyN4HL2IgqUUWrIZBipAUeMS oJUQ== Original-Received: by 10.204.147.1 with SMTP id j1mr2727202bkv.110.1348258103596; Fri, 21 Sep 2012 13:08:23 -0700 (PDT) Original-Received: from thinkpad.home ([77.64.254.200]) by mx.google.com with ESMTPS id d13sm6310548bkw.12.2012.09.21.13.08.22 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 21 Sep 2012 13:08:22 -0700 (PDT) User-Agent: KMail/4.9.1 (Linux/3.5.4-1-default; KDE/4.9.1; i686; ; ) In-Reply-To: <5051974D.2020106@cs.ucla.edu> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:64706 Archived-At: 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