On 11/07/10 15:55, Bruno Haible wrote:
>> Seg faulting is even less friendly.
>
> A seg fault is a very clear hint to the developer that he needs to fix up his
> code. Which IMO is the only good solution if a programmer has not defined
> program_name.
But it would only be encountered if the progr
Hi Bruce,
> > 1) It will cause a link error for all programs that define the
> > 'program_name'
> > variable, on all non-ELF platforms (mainly MacOS X and Woe32).
... and HP-UX, which also is a non-ELF platform.
> Not having MacOS or Woe32, I couldn't know.
There is some code for determ
On 11/07/10 12:40, Bruno Haible wrote:
> No, this is not OK, for two reasons:
> 1) It will cause a link error for all programs that define the
> 'program_name'
> variable, on all non-ELF platforms (mainly MacOS X and Woe32).
Not having MacOS or Woe32, I couldn't know.
> 2) Substituting
Bruce Korb wrote:
> error.c has an unnecessary dependency on "program_name"
No, it is not an "unnecessary" dependency. There is no portable way for code
in a module to determine the name of the current program. Programs that use the
'error' module must define the
It is fairly easy to fix, just make the definition weak
and check for a NULL value before using it. OK to push?
index ed9dba0..65f2d9d 100644
--- a/lib/error.c
+++ b/lib/error.c
@@ -106,7 +106,7 @@ char *strerror_r ();
/* The calling program should define program_name and set it to the
name