From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Brett Gilio Newsgroups: gmane.lisp.guile.devel Subject: Re: Removing the locale warning? Date: Sat, 14 Dec 2019 18:22:11 -0600 Message-ID: <87eex6wi8c.fsf@posteo.net> References: <87mubuyks9.fsf@inria.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="186506"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) Cc: Andy Wingo , Guile Devel To: Ludovic =?utf-8?Q?Court=C3=A8s?= Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sun Dec 15 01:22:53 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 1igHgS-000mNQ-4r for guile-devel@m.gmane.org; Sun, 15 Dec 2019 01:22:52 +0100 Original-Received: from localhost ([::1]:34864 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igHgR-00005g-22 for guile-devel@m.gmane.org; Sat, 14 Dec 2019 19:22:51 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47632) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igHgD-00005Z-TF for guile-devel@gnu.org; Sat, 14 Dec 2019 19:22:39 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1igHgC-0008WM-Gh for guile-devel@gnu.org; Sat, 14 Dec 2019 19:22:37 -0500 Original-Received: from mout01.posteo.de ([185.67.36.65]:44877) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1igHgB-0008MR-Tu for guile-devel@gnu.org; Sat, 14 Dec 2019 19:22:36 -0500 Original-Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id 71E7E160061 for ; Sun, 15 Dec 2019 01:22:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1576369352; bh=NmIAEBmdhbNKlAOZDy/yYm4UMA/tXz+hnwhXtjdL/tc=; h=From:To:Cc:Subject:Date:From; b=TIaJQdmp8ou9F5+DNfcIPv/E18S3Lmxqsjwnl14Kg4onpvtlmXEOoz4Ts/OqKU8Ug tBAvButQckmmlFnEvmbD2976/HR2QwIRT23tH9AqaKufardX1cQ7XrlcuGIuA6ASxr DjgqXUtSxWjGJA4FY4EnYO/9Jgo1A9G+nBYug0Uja4Ngi/HirPvhQ4lpJJBmF34H1s tvhs93l66ourVyCXHgaKUXEFHjCPlDKPFt/OH3z/4JIlpG02crJu3SiL5twjOG77Jc Pgp+VJnvJbbwrECiJEzrCB+s7MAc5+L/1eFZIx4fE8BuHJ5FhEljxf1gVQuOdBnp/J BVd3g1qJucMWQ== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 47b4q01XHJz6tmB; Sun, 15 Dec 2019 01:22:20 +0100 (CET) In-Reply-To: <87mubuyks9.fsf@inria.fr> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22\?\= \=\?utf-8\?Q\?'s\?\= message of "Sat, 14 Dec 2019 16:44:06 +0100") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 185.67.36.65 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:20195 Archived-At: Ludovic Court=C3=A8s writes: > 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 (p= lus > they=E2=80=99re not i18n=E2=80=99d), and because application developers c= annot silence > them or handle them in a way that is more suitable for the application. > > Thoughts? > > Ludo=E2=80=99. > > 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. >=20=20 > 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, "") =3D=3D 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, ""); >=20=20 > scm_install_gmp_memory_functions =3D 1; > scm_boot_guile (argc, argv, inner_main, 0); > I like this idea, and it looks like it is handled well. It seems like something we should move toward with our Guile 3 progress in my opinion. --=20 Brett M. Gilio Homepage -- https://scm.pw/ GNU Guix -- https://guix.gnu.org/