bug-gnulib
[Top][All Lists]
Advanced

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

Re: [bug-gnulib] program_name in error.c


From: Sergey Poznyakoff
Subject: Re: [bug-gnulib] program_name in error.c
Date: Sat, 09 Sep 2006 18:43:44 +0300

Bruno Haible <address@hidden> wrote:

> - Why do you use HAVE_PROGRAM_INVOCATION_NAME here, whereas argp.m4
>   defines GNULIB_PROGRAM_INVOCATION_NAME ?

Yes, I meant GNULIB_PROGRAM_INVOCATION_NAME, of course.
 
> - If the #ifdef condition is true, you'll be using the
>   program_invocation_name without having a declaration for it (since
>   argp-namefrob.h has not been included as this point).

Good point.  I didn't notice it.
 
> - Programs using the 'error' module are responsible for defining a variable
>   'program_name' and initializing it. If error.c now uses a different
>   variable, who is responsible for initializing it?

Actually, it uses this variable in glibc as well.  argp_parse is
responsible for setting it.  

> Can you guarantee that error() will not be invoked before this
> initialization?

No, of course I cannot.  If it is called before argp_parse it will
surely coredump.  But then, we cannot guarantee that whoever is using
this interface will set program_name before calling error(), can we?

Regards,
Sergey






reply via email to

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