bug-gnulib
[Top][All Lists]
Advanced

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

Re: getprogname and libtool


From: Bruno Haible
Subject: Re: getprogname and libtool
Date: Sun, 18 Dec 2016 00:27:36 +0100
User-agent: KMail/4.8.5 (Linux/3.8.0-44-generic; KDE/4.8.5; x86_64; ; )

Followup to this discussion from October 2016:

Jim:
> > I did not mean to imply by that message that we should eliminate every
> > use of the program_name module. My desire is more to avoid accidental
> > use of it when the getprogname module would be more appropriate.

Bruno:
> Fully agree on this.
> 
> The way I currently see it, the two modules serve different purposes
> and it's easy to decide which one to use in which case:
> 
>   * In a program's main() function, and associated usage() and help()
>     functions, use set_program_name and program_name.
> 
>     Rationale: This provides the full name of the executable, and discards
>     the "lt-" prefix.
> 
>   * In library code, or more generally any code that is not near the
>     main() function, use getprogname().
> 
>     Rationale: This makes it possible to put this library code under LGPL
>     and avoid the many linker errors to 'program_name' that people have
>     been seeing.

In consequence, I'm editing NEWS accordingly.


2016-12-17  Bruno Haible  <address@hidden>

        Un-deprecate the 'getprogname' module.
        * NEWS: Describe the appropriate use-cases of 'progname' versus
        'getprogname'. Based on discussion summary at
        http://lists.gnu.org/archive/html/bug-gnulib/2016-10/msg00105.html

diff --git a/NEWS b/NEWS
index 07ca87e..fbbf6f2 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,16 @@ Important general notes
 
 Date        Modules         Changes
 
+2016-09-05  progname        There is now an alternate module 'getprogname'. It
+                            defines a getprogname() function; use it to obtain
+                            the name of the current program.
+                            Recommended use:
+                            - In a program's main() function, and associated
+                              usage() and help() functions, use 'progname'.
+                            - In library code, or more generally any code that
+                              is not near the main() function, use
+                              'getprogname'.
+
 2013-04-24  gettext         If your project uses 'gettextize --intl' it is now
                             your responsibility to put -I$(top_builddir)/intl
                             into the Makefile.am for gnulib.
@@ -37,14 +47,6 @@ Date        Modules         Changes
 2016-11-17  unistr/u32-strmblen   The function u32_strmblen can now return -1.
 2016-11-17  unistr/u32-strmbtouc  The function u32_strmbtouc can now return -1.
 
-2016-09-05  progname        This module is deprecated.  Please switch to the
-                            'getprogname' module and its getprogname()
-                            function to obtain the name of the current program.
-                            Note that there is no longer any need to export a
-                            'const char *program_name' variable.
-                            Currently there is no replacement for
-                            set_program_name().
-
 2016-08-17  stdbool         This no longer supports _Bool for C++.
                             Programs intended to be portable to C++
                             compilers should use plain 'bool' instead.




reply via email to

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