Sergey Poznyakoff wrote: > --- error.c 29 Aug 2006 16:58:34 -0000 1.46 > +++ error.c 9 Sep 2006 05:39:50 -0000 > @@ -92,9 +92,13 @@ extern void __error_at_line (int status, > char *strerror_r (); > # endif > > +#ifdef HAVE_PROGRAM_INVOCATION_NAME > +# define program_name program_invocation_name > +#else > /* The calling program should define program_name and set it to the > name of the executing program. */ > extern char *program_name; > +#endif > > # if HAVE_STRERROR_R || defined strerror_r > # define __strerror_r strerror_r >
- Why do you use HAVE_PROGRAM_INVOCATION_NAME here, whereas argp.m4 defines GNULIB_PROGRAM_INVOCATION_NAME ? - 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). - 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? Can you guarantee that error() will not be invoked before this initialization? Bruno