bug-gnulib
[Top][All Lists]
Advanced

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

Re: [PATCHv2] strerror: drop strerror_r dependency


From: Bruno Haible
Subject: Re: [PATCHv2] strerror: drop strerror_r dependency
Date: Sat, 4 Jun 2011 11:13:26 +0200
User-agent: KMail/1.9.9

> 2011-06-03  Bruno Haible  <address@hidden>
> 
>       strerror-override: Don't disable symbol renamings.
>       * lib/strerror-override.c: Include config.h.
>       (strerror_override): Don't undefine.

This patch alone leads to a compilation error, because at the point of the
definition of the function in strerror-override.c, strerror_override expands
to NULL! Obviously, one needs to include <errno.h> before testing
GNULIB_defined_ETXTBSY. And including <string.h> is overkill just for getting
NULL defined - <stddef.h> is the minimal header.


2011-06-04  Bruno Haible  <address@hidden>

        strerror-override: Don't disable symbol renamings.
        * lib/strerror-override.h: Include errno.h and stddef.h, not string.h.
        * lib/strerror-override.c: Include config.h.
        (strerror_override): Don't undefine.

--- lib/strerror-override.c.orig        Sat Jun  4 10:54:19 2011
+++ lib/strerror-override.c     Sat Jun  4 02:16:46 2011
@@ -17,6 +17,8 @@
 
 /* Written by Bruno Haible <address@hidden>, 2010.  */
 
+#include <config.h>
+
 #include "strerror-override.h"
 
 #include <errno.h>
@@ -27,10 +29,6 @@
 # endif
 #endif
 
-/* This undefine allows testing with gl_cv_header_errno_h_complete=no on
-   a system that otherwise has a complete errno.h.  */
-#undef strerror_override
-
 /* If ERRNUM maps to an errno value defined by gnulib, return a string
    describing the error.  Otherwise return NULL.  */
 const char *
--- lib/strerror-override.h.orig        Sat Jun  4 10:54:19 2011
+++ lib/strerror-override.h     Sat Jun  4 04:32:21 2011
@@ -18,7 +18,8 @@
 #ifndef _GL_STRERROR_OVERRIDE_H
 # define _GL_STRERROR_OVERRIDE_H
 
-# include <string.h>
+# include <errno.h>
+# include <stddef.h>
 
 /* Reasonable buffer size that should never trigger ERANGE; if this
    proves too small, we intentionally abort(), to remind us to fix

-- 
In memoriam Mordechai Gebirtig <http://en.wikipedia.org/wiki/Mordechai_Gebirtig>



reply via email to

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