bug-gnulib
[Top][All Lists]
Advanced

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

Re: [Bug-gnulib] new module: progname


From: Paul Eggert
Subject: Re: [Bug-gnulib] new module: progname
Date: 18 Aug 2003 15:22:07 -0700
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

Bruno Haible <address@hidden> writes:

>   /* Set program name for messages.  */
>   set_program_name (argv[0]);
>   error_print_progname = maybe_print_progname;

This advice seems overly complex.  Can we simplify the advice to
'set_program_name (argv[0])'?  Surely the code works in that case,
and I'd think that most applications don't need the additional
complexity of error_with_progname.

Also, can we avoid having the error_with_progname boolean?
Applications that want to print program names in error messages can
invoke set_program_name; applications that don't want it can not
invoke set_program_name.  That way, we don't need the boolean.

Or perhaps the boolean was intended to let you switch off the program
names in some cases, by setting a global variable? I'm not sure this
capability is needed, but if so it could be implemented with
set_program_name (NULL).

The basic idea is to simplify program.h to this interface:

extern const char *program_name;
extern void set_program_name (const char *argv0);

in the !ENABLE_RELOCATABLE case.




reply via email to

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