unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Brett Gilio <brettg@posteo.net>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: Andy Wingo <wingo@igalia.com>, Guile Devel <guile-devel@gnu.org>
Subject: Re: Removing the locale warning?
Date: Sat, 14 Dec 2019 18:22:11 -0600	[thread overview]
Message-ID: <87eex6wi8c.fsf@posteo.net> (raw)
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")

Ludovic Courtès <ludo@gnu.org> 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’t care about them (plus
> they’re not i18n’d), and because application developers cannot silence
> them or handle them in a way that is more suitable for the application.
>
> Thoughts?
>
> Ludo’.
>
> 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
>       <https://lists.gnu.org/archive/html/guile-devel/2011-11/msg00041.html>
>       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);
>

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.

-- 
Brett M. Gilio
Homepage -- https://scm.pw/
GNU Guix -- https://guix.gnu.org/



  reply	other threads:[~2019-12-15  0:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-14 15:44 Removing the locale warning? Ludovic Courtès
2019-12-15  0:22 ` Brett Gilio [this message]
2019-12-16 14:10 ` Andy Wingo
2019-12-16 16:06   ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87eex6wi8c.fsf@posteo.net \
    --to=brettg@posteo.net \
    --cc=guile-devel@gnu.org \
    --cc=ludo@gnu.org \
    --cc=wingo@igalia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).