bug-gnulib
[Top][All Lists]
Advanced

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

[Bug-gnulib] `fatal' module problem?


From: Simon Josefsson
Subject: [Bug-gnulib] `fatal' module problem?
Date: Tue, 03 Aug 2004 18:37:22 +0200
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (gnu/linux)

The `fatal' module look plain broken to me:

void
fatal (int errnum, const char *message, ...)
{
  va_list args;
...
  va_start (args, message);
  error (EXIT_FAILURE, errnum, message, args);

But error doesn't take a va_list, from error.h:

extern void error (int __status, int __errnum, const char *__format, ...)
     __attribute__ ((__format__ (__printf__, 3, 4)));

There is error_tail in error.c, that takes va_list, but it isn't
marked as 'extern'.  Furthermore, the error.m4 only test for
error_at_line, so even if it is marked as 'extern', error.c won't get
compiled on, e.g., glibc systems, so fatal fail to build.

One solution:

* Make error.m4 look for error_tail, and build error.c if it is not present.
* Make error_tail an 'extern' symbol, and include it in error.h.
* Make fatal use error_tail.

I'm not sure this is the best solution.  Any ideas?  I'm hoping that I
might have simply missed something, and that fatal.c really works.

Thanks.

rm -rf /tmp/testdir/&&./gnulib-tool --create-testdir --dir=/tmp/testdir fatal 
progname

#include "config.h"
#include <progname.h>
#include <fatal.h>
int main (int argc, char *argv[])
{
  set_program_name (argv[0]);
  fatal (0, "foo %s bar", "baz");
}




reply via email to

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