[Top][All Lists]

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

Removing the locale warning?

From: Ludovic Courtès
Subject: Removing the locale warning?
Date: Sat, 14 Dec 2019 16:44:06 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)


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.



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);

reply via email to

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