bug-gnulib
[Top][All Lists]
Advanced

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

Re: error.c has an unnecessary dependency on "program_name"


From: Bruno Haible
Subject: Re: error.c has an unnecessary dependency on "program_name"
Date: Mon, 8 Nov 2010 00:55:18 +0100
User-agent: KMail/1.9.9

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 determining the program's name ad-hoc for MacOS X
and Woe32 in progreloc.c. But for HP-UX, I don't know...

If you don't have access to these systems and no one else find a good
solution, then you will likely have to document: "Before using libposix,
you have to invoke set_program_name(argv[0]);" and add the module 'progname'
to libposix. I think that's an acceptable compromise: many users of gnulib
have done the same for the last 7 years.

> >   2) Substituting "unknown" instead of a real program name will not help the
> >      end user.
> 
> 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.

Bruno



reply via email to

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