Bruce Korb wrote: > This patch modifies lib/error.c so that should someone > call it without having set program_name, then a message > is printed and abort() called instead of seg faulting.
A link error would be best, to detect this situation. If we cannot get a link error, an abort() is a small improvement, but a better improvement would be incorporate code that determines the program name on platforms like MacOS X, mingw, or HP-UX. (See progreloc.c.) > -extern char *program_name; > +#ifdef HPUX > +extern > +#endif > +char *program_name; What is this doing? I hope you're not turning a link error into a runtime error. Btw, 'HPUX' is not a predefined macro on any platform. For predefined macros, look at http://predef.sourceforge.net/. > -#if _LIBC > - __fxprintf (NULL, "%s:", program_name); > -#else > - fprintf (stderr, "%s:", program_name); > -#endif > - } > + pr_prog_name (); > > #if _LIBC > __fxprintf (NULL, file_name != NULL ? "%s:%d: " : " ", This inserts an additional space in the output. It will then not have the format "prog:file:line: message" that is standardized in <http://www.gnu.org/prep/standards/html_node/Errors.html>. Is this intended? Bruno