[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-gnulib] further error.c patch to assume c89
From: |
Paul Eggert |
Subject: |
[Bug-gnulib] further error.c patch to assume c89 |
Date: |
12 Sep 2003 12:49:59 -0700 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 |
While looking into something else I noticed that error.c can be
further simplified if we assume c89. I installed this patch.
vprintf is in SunOS 4.1.4 so this should be OK.
2003-09-12 Paul Eggert <address@hidden>
* error.c (error_tail): Assume vprintf.
* error.m4 (gl_ERROR): Don't check for vprintf.
Require AC_FUNC_STRERROR_R rather than invoking it.
Index: lib/error.c
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/error.c,v
retrieving revision 1.32
diff -p -u -r1.32 error.c
--- lib/error.c 10 Sep 2003 08:33:11 -0000 1.32
+++ lib/error.c 12 Sep 2003 19:43:25 -0000
@@ -132,11 +132,10 @@ print_errno_message (int errnum)
static void
error_tail (int status, int errnum, const char *message, va_list args)
{
-#if HAVE_VPRINTF || _LIBC
-# if _LIBC
+#if _LIBC
if (_IO_fwide (stderr, 0) > 0)
{
-# define ALLOCA_LIMIT 2000
+# define ALLOCA_LIMIT 2000
size_t len = strlen (message) + 1;
wchar_t *wmessage = NULL;
mbstate_t st;
@@ -174,11 +173,8 @@ error_tail (int status, int errnum, cons
__vfwprintf (stderr, wmessage, args);
}
else
-# endif
- vfprintf (stderr, message, args);
-#else
- _doprnt (message, args, stderr);
#endif
+ vfprintf (stderr, message, args);
va_end (args);
++error_message_count;
@@ -200,7 +196,6 @@ error_tail (int status, int errnum, cons
format string with optional args.
If ERRNUM is nonzero, print its corresponding system error message.
Exit with status STATUS if it is nonzero. */
-/* VARARGS */
void
error (int status, int errnum, const char *message, ...)
{
Index: m4/error.m4
===================================================================
RCS file: /cvsroot/gnulib/gnulib/m4/error.m4,v
retrieving revision 1.13
diff -p -u -r1.13 error.m4
--- m4/error.m4 8 Sep 2003 23:26:06 -0000 1.13
+++ m4/error.m4 12 Sep 2003 19:43:25 -0000
@@ -1,4 +1,4 @@
-#serial 8
+#serial 9
AC_DEFUN([gl_ERROR],
[
@@ -10,6 +10,6 @@ AC_DEFUN([gl_ERROR],
# Prerequisites of lib/error.c.
AC_DEFUN([jm_PREREQ_ERROR],
[
- AC_REQUIRE([AC_FUNC_VPRINTF])
- AC_FUNC_STRERROR_R
+ AC_REQUIRE([AC_FUNC_STRERROR_R])
+ :
])
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Bug-gnulib] further error.c patch to assume c89,
Paul Eggert <=