bug-gnulib
[Top][All Lists]
Advanced

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

error: avoid gcc warning


From: Bruno Haible
Subject: error: avoid gcc warning
Date: Sun, 5 Jun 2011 15:00:13 +0200
User-agent: KMail/1.9.9

On OSF/1 5.1 with gcc, I'm seeing this warning:

  error.c:170: warning: implicit declaration of function 'strerror_r'

It's because /usr/include/string.h on this system does not always declare
strerror_r (only if _REENTRANT or _THREAD_SAFE is defined). This fixes it
(without requiring the 'strerror_r' module).


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

        error: Avoid gcc warning.
        * lib/error.c (strerror_r): Declare also when its return type is 'int'.

--- lib/error.c.orig    Sun Jun  5 14:50:15 2011
+++ lib/error.c Sun Jun  5 14:49:59 2011
@@ -97,11 +97,15 @@
 /* The gnulib override of fcntl is not needed in this file.  */
 # undef fcntl
 
-# if !HAVE_DECL_STRERROR_R && STRERROR_R_CHAR_P
+# if !HAVE_DECL_STRERROR_R
 #  ifndef HAVE_DECL_STRERROR_R
 "this configure-time declaration test was not run"
 #  endif
+#  if STRERROR_R_CHAR_P
 char *strerror_r ();
+#  else
+int strerror_r ();
+#  endif
 # endif
 
 /* The calling program should define program_name and set it to the
-- 
In memoriam Eduard Lederer <http://de.wikipedia.org/wiki/Eduard_Lederer>



reply via email to

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