bug-gnulib
[Top][All Lists]
Advanced

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

Re: [Bug-gnulib] strdup: fix warnings


From: Paul Eggert
Subject: Re: [Bug-gnulib] strdup: fix warnings
Date: Fri, 06 Aug 2004 20:00:44 -0700
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

Simon Josefsson <address@hidden> writes:

> 2004-08-03  Simon Josefsson  <address@hidden>
>
>       * strdup.m4: Always run gl_PREREQ_STRDUP, since strdup.h need it.

Thanks.  I installed that patch, but moved the call to
gl_PREREQ_STRDUP into gl_FUNC_STRDUP, which is a better place for it
(though equivalent effect for you).  Also, I changed an AC_CHECK_DECLS
to an AC_CHECK_DECLS_ONCE just on general principle.  Here's what I
installed.

2004-08-03  Simon Josefsson  <address@hidden>

        * lib/strdup.h: Only use HAVE_DECL_STRDUP if defined.
        * m4/strdup.m4: Always run gl_PREREQ_STRDUP, since strdup.h need it.

Index: lib/strdup.h
===================================================================
RCS file: /cvsroot/gnulib/gnulib/lib/strdup.h,v
retrieving revision 1.1
diff -p -u -r1.1 strdup.h
--- lib/strdup.h        25 Feb 2004 19:46:30 -0000      1.1
+++ lib/strdup.h        7 Aug 2004 02:57:04 -0000
@@ -21,7 +21,7 @@
 /* Get strdup declaration, if available.  */
 #include <string.h>
 
-#if !HAVE_DECL_STRDUP && !defined strdup
+#if defined HAVE_DECL_STRDUP && !HAVE_DECL_STRDUP && !defined strdup
 /* Duplicate S, returning an identical malloc'd string.  */
 extern char *strdup (const char *s);
 #endif
Index: m4/strdup.m4
===================================================================
RCS file: /cvsroot/gnulib/gnulib/m4/strdup.m4,v
retrieving revision 1.3
diff -p -u -r1.3 strdup.m4
--- m4/strdup.m4        25 Feb 2004 19:39:07 -0000      1.3
+++ m4/strdup.m4        7 Aug 2004 02:57:04 -0000
@@ -1,4 +1,4 @@
-# strdup.m4 serial 3
+# strdup.m4 serial 4
 dnl Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
 dnl This file is free software, distributed under the terms of the GNU
 dnl General Public License.  As a special exception to the GNU General
@@ -9,12 +9,9 @@ dnl the same distribution terms as the r
 AC_DEFUN([gl_FUNC_STRDUP],
 [
   AC_REPLACE_FUNCS(strdup)
-  if test $ac_cv_func_strdup = no; then
-    gl_PREREQ_STRDUP
-  fi
+  AC_CHECK_DECLS_ONCE(strdup)
+  gl_PREREQ_STRDUP
 ])
 
-# Prerequisites of lib/strdup.h and lib/strdup.c.
-AC_DEFUN([gl_PREREQ_STRDUP], [
-  AC_CHECK_DECLS(strdup)
-])
+# Prerequisites of lib/strdup.c.
+AC_DEFUN([gl_PREREQ_STRDUP], [:])




reply via email to

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