From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Ludovic_Court=C3=A8s?= Newsgroups: gmane.lisp.guile.devel Subject: Removing the locale warning? Date: Sat, 14 Dec 2019 16:44:06 +0100 Message-ID: <87mubuyks9.fsf@inria.fr> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="74909"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) Cc: Andy Wingo To: Guile Devel Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sat Dec 14 23:43:57 2019 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1igG8i-000JKK-Q8 for guile-devel@m.gmane.org; Sat, 14 Dec 2019 23:43:56 +0100 Original-Received: from localhost ([::1]:34156 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igG8g-0000JS-Vp for guile-devel@m.gmane.org; Sat, 14 Dec 2019 17:43:54 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42364) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igG8F-0000JB-Kb for guile-devel@gnu.org; Sat, 14 Dec 2019 17:43:28 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:36420) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1igG8D-0007Sn-QZ; Sat, 14 Dec 2019 17:43:25 -0500 Original-Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=37550 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ig9aR-0003RI-Lw; Sat, 14 Dec 2019 10:44:07 -0500 X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 24 Frimaire an 228 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.org gmane.lisp.guile.devel:20194 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello! What about getting rid of the locale warning, as shown below? More generally, I'm in favor of reducing run-time warnings to a bare minimum, because application users often don=E2=80=99t care about them (plus they=E2=80=99re not i18n=E2=80=99d), and because application developers can= not silence them or handle them in a way that is more suitable for the application. Thoughts? Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/libguile/guile.c b/libguile/guile.c index fa5fef928..e8879caad 100644 --- a/libguile/guile.c +++ b/libguile/guile.c @@ -1,4 +1,4 @@ -/* Copyright 1996-1997,2000-2001,2006,2008,2011,2013,2018 +/* Copyright 1996-1997,2000-2001,2006,2008,2011,2013,2018,2019 Free Software Foundation, Inc. This file is part of Guile. @@ -88,8 +88,10 @@ main (int argc, char **argv) error messages, use the right locale. See for the rationale. */ - if (should_install_locale () && setlocale (LC_ALL, "") == NULL) - fprintf (stderr, "guile: warning: failed to install locale\n"); + if (should_install_locale ()) + /* Silently ignore 'setlocale' failures. It's up to the application + to handle it. */ + setlocale (LC_ALL, ""); scm_install_gmp_memory_functions = 1; scm_boot_guile (argc, argv, inner_main, 0); --=-=-=--