From e1c5c74989afaf386aa8516956aba0a16df777b7 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Fri, 22 Sep 2006 20:10:26 +0000 Subject: [PATCH] Avoid warning at configure time with "gcc -Wall". --- m4/ChangeLog | 10 ++++++++++ m4/lock.m4 | 3 ++- m4/mbswidth.m4 | 3 ++- m4/signed.m4 | 7 ++++--- m4/vasprintf.m4 | 12 ++++++++++-- 5 files changed, 28 insertions(+), 7 deletions(-) diff --git a/m4/ChangeLog b/m4/ChangeLog index 84f6101a0..c594eecba 100644 --- a/m4/ChangeLog +++ b/m4/ChangeLog @@ -1,4 +1,14 @@ 2006-09-22 Ralf Wildenhues + Bruno Haible + + * lock.m4 (gl_LOCK_BODY): Avoid unused variables warning. + * mbswidth.m4 (gl_MBSWIDTH): Likewise. + * signed.m4 (bh_C_SIGNED): Likewise. + + * vasprintf.m4 (gl_PREREQ_VASPRINTF_H): New macro. + (gl_FUNC_VASPRINTF): Invoke it. + +2006-09-22 Ralf Wildenhues * fsusage.m4 (gl_STATFS_TRUNCATES): Avoid unused variable. * getdate.m4 (gl_C_COMPOUND_LITERALS): Likewise. diff --git a/m4/lock.m4 b/m4/lock.m4 index 1ab72164f..94c1870da 100644 --- a/m4/lock.m4 +++ b/m4/lock.m4 @@ -1,4 +1,4 @@ -# lock.m4 serial 4 (gettext-0.15.1) +# lock.m4 serial 5 (gettext-0.15.1) dnl Copyright (C) 2005-2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -147,6 +147,7 @@ AC_HELP_STRING([--disable-threads], [build without multithread safety]), error "No, in FreeBSD 4.0 recursive mutexes actually don't work." #else int x = (int)PTHREAD_MUTEX_RECURSIVE; +return !x; #endif], [AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE], 1, [Define if the defines PTHREAD_MUTEX_RECURSIVE.])]) diff --git a/m4/mbswidth.m4 b/m4/mbswidth.m4 index 3cb200039..5aff74eb5 100644 --- a/m4/mbswidth.m4 +++ b/m4/mbswidth.m4 @@ -1,4 +1,4 @@ -# mbswidth.m4 serial 12 +# mbswidth.m4 serial 13 dnl Copyright (C) 2000-2002, 2004, 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -24,6 +24,7 @@ AC_DEFUN([gl_MBSWIDTH], #endif ], [ char *p = (char *) mbswidth; + return !p; ], ac_cv_have_decl_mbswidth=yes, ac_cv_have_decl_mbswidth=no)]) if test $ac_cv_have_decl_mbswidth = yes; then ac_val=1 diff --git a/m4/signed.m4 b/m4/signed.m4 index 048f59369..5ac767284 100644 --- a/m4/signed.m4 +++ b/m4/signed.m4 @@ -1,5 +1,5 @@ -# signed.m4 serial 1 (gettext-0.10.40) -dnl Copyright (C) 2001-2002 Free Software Foundation, Inc. +# signed.m4 serial 2 +dnl Copyright (C) 2001-2002, 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -9,7 +9,8 @@ dnl From Bruno Haible. AC_DEFUN([bh_C_SIGNED], [ AC_CACHE_CHECK([for signed], bh_cv_c_signed, - [AC_TRY_COMPILE(, [signed char x;], bh_cv_c_signed=yes, bh_cv_c_signed=no)]) + [AC_TRY_COMPILE(, [signed char x; return !x;], + bh_cv_c_signed=yes, bh_cv_c_signed=no)]) if test $bh_cv_c_signed = no; then AC_DEFINE(signed, , [Define to empty if the C compiler doesn't support this keyword.]) diff --git a/m4/vasprintf.m4 b/m4/vasprintf.m4 index 385e92edd..18ca6327b 100644 --- a/m4/vasprintf.m4 +++ b/m4/vasprintf.m4 @@ -1,5 +1,5 @@ -# vasprintf.m4 serial 1 -dnl Copyright (C) 2002-2003 Free Software Foundation, Inc. +# vasprintf.m4 serial 2 +dnl Copyright (C) 2002-2003, 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -9,11 +9,19 @@ AC_DEFUN([gl_FUNC_VASPRINTF], AC_REPLACE_FUNCS(vasprintf) if test $ac_cv_func_vasprintf = no; then AC_LIBOBJ(asprintf) + gl_PREREQ_VASPRINTF_H gl_PREREQ_VASPRINTF gl_PREREQ_ASPRINTF fi ]) +# Prerequisites of lib/vasprintf.h. +AC_DEFUN([gl_PREREQ_VASPRINTF_H], +[ + dnl Persuade glibc to declare asprintf() and vasprintf(). + AC_REQUIRE([AC_GNU_SOURCE]) +]) + # Prerequisites of lib/vasprintf.c. AC_DEFUN([gl_PREREQ_VASPRINTF], [ -- 2.11.0