[Top][All Lists]

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

strerror_r and argp

From: Bruno Haible
Subject: strerror_r and argp
Date: Sun, 29 May 2011 15:00:24 +0200
User-agent: KMail/1.9.9

When compiling a testdir with argp and strerror_r-posix on a glibc system, I
get this warning:

argp-help.c:1921: warning: assignment makes pointer from integer without a cast

This patch fixes it.

2011-05-29  Bruno Haible  <address@hidden>

        argp: Allow coexistence with strerror_r-posix module.
        * lib/argp-help.c (__argp_failure): If strerror_r is defined as a macro
        (either to __xpg_strerror_r by glibc's <string.h> or to rpl_strerror_r
        by gnulib's <string.h> replacement), assume it has the POSIX signature,
        not the glibc signature.

--- lib/argp-help.c.orig        Sun May 29 14:55:07 2011
+++ lib/argp-help.c     Sun May 29 14:53:46 2011
@@ -1917,7 +1917,7 @@
                   char const *s = NULL;
                   putc_unlocked (':', stream);
                   putc_unlocked (' ', stream);
+#if _LIBC || (HAVE_DECL_STRERROR_R && STRERROR_R_CHAR_P && !defined strerror_r)
                   s = __strerror_r (errnum, buf, sizeof buf);
                   if (__strerror_r (errnum, buf, sizeof buf) == 0)

In memoriam John Penry <http://en.wikipedia.org/wiki/John_Penry>

reply via email to

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