Hello Simon, Jim, Paul, Bruno, all, OK to apply these patches to make ./configure CC='gcc -Wall -Werror -fno-builtin'
work better (tested on GNU/Linux) with these tests? (Mind you, I haven't tested any of these changes on other systems.) Bruno, maybe it's time to kill signed.m4 or make it a noop? Cheers, Ralf * fnmatch.m4 (_AC_FUNC_FNMATCH_IF): Avoid expression that is always true. * strndup.m4 (gl_FUNC_STRNDUP): include stdlib.h, for `free'. * sockpfaf.m4 (gl_SOCKET_FAMILIES): Avoid gcc -Wall warnings. * fsusage.m4 (gl_STATFS_TRUNCATES): Avoid unused variable. * getdate.m4 (gl_C_COMPOUND_LITERALS): Likewise. * jm-winsz1.m4 (gl_HEADER_TIOCGWINSZ_IN_TERMIOS_H): Likewise; also add missing comma that caused broken test. * link-follow.m4 (gl_AC_FUNC_LINK_FOLLOWS_SYMLINK): Include stdlib.h, for `abort'. * ls-mntd-fs.m4 (gl_LIST_MOUNTED_FILE_SYSTEMS): Avoid unused variables. * mkdir-slash.m4 (gl_FUNC_MKDIR_TRAILING_SLASH): Include unistd.h if present, for `rmdir'. * physmem.m4 (gl_SYS__SYSTEM_CONFIGURATION): Avoid unused variables. * putenv.m4 (gl_FUNC_PUTENV): Rewrite using AC_RUN_IFELSE, and in the process include standard headers for prototypes. * readutmp.m4 (gl_READUTMP): Require AC_GNU_SOURCE, so utmpxname gets declared on GNU/Linux. * rmdir-errno.m4 (gl_FUNC_RMDIR_NOTEMPTY): Include unistd.h, for `rmdir'. * time_r.m4 (gl_TIME_R): Avoid unused variables. * lock.m4 (gl_LOCK_BODY): Avoid unused variables. * mbswidth.m4 (gl_MBSWIDTH): Likewise. * signed.m4 (bh_C_SIGNED): Likewise. * stpncpy.m4 (gl_FUNC_STPNCPY): Likewise. * vasprintf.m4 (gl_FUNC_VASPRINTF): Require AC_GNU_SOURCE, so vasprintf is declared on GNU/Linux.
Index: m4/fnmatch.m4 =================================================================== CS file: /cvsroot/gnulib/gnulib/m4/fnmatch.m4,v retrieving revision 1.24 diff -u -r1.24 fnmatch.m4 --- m4/fnmatch.m4 31 Aug 2006 22:29:01 -0000 1.24 +++ m4/fnmatch.m4 22 Sep 2006 03:13:42 -0000 @@ -35,7 +35,7 @@ } ], [exit - (!((fnm ? fnm : fnmatch) ("a*", "", 0) == FNM_NOMATCH + (!(fnm ("a*", "", 0) == FNM_NOMATCH && y ("a*", "abc", 0) && n ("d*/*1", "d/s/1", FNM_PATHNAME) && y ("a\\\\bc", "abc", 0) Index: m4/strndup.m4 =================================================================== RCS file: /cvsroot/gnulib/gnulib/m4/strndup.m4,v retrieving revision 1.9 diff -u -r1.9 strndup.m4 --- m4/strndup.m4 21 Aug 2006 21:46:31 -0000 1.9 +++ m4/strndup.m4 22 Sep 2006 03:13:43 -0000 @@ -1,4 +1,4 @@ -# strndup.m4 serial 8 +# strndup.m4 serial 9 dnl Copyright (C) 2002-2003, 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, @@ -14,7 +14,8 @@ # AIX 4.3.3, AIX 5.1 have a function that fails to add the terminating '\0'. AC_CACHE_CHECK([for working strndup], gl_cv_func_strndup, [AC_RUN_IFELSE([ - AC_LANG_PROGRAM([#include <string.h>], [[ + AC_LANG_PROGRAM([#include <string.h> + #include <stdlib.h>], [[ #ifndef HAVE_DECL_STRNDUP extern char *strndup (const char *, size_t); #endif
Index: m4/sockpfaf.m4 =================================================================== RCS file: /cvsroot/gnulib/gnulib/m4/sockpfaf.m4,v retrieving revision 1.4 diff -u -r1.4 sockpfaf.m4 --- m4/sockpfaf.m4 5 Jul 2006 18:06:09 -0000 1.4 +++ m4/sockpfaf.m4 22 Sep 2006 03:13:43 -0000 @@ -1,4 +1,4 @@ -# sockpfaf.m4 serial 4 +# sockpfaf.m4 serial 6 dnl Copyright (C) 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, @@ -28,7 +28,8 @@ #ifdef HAVE_WINSOCK2_H #include <winsock2.h> #endif], -[int x = AF_INET; struct in_addr y; struct sockaddr_in z;], +[int x = AF_INET; struct in_addr y; struct sockaddr_in z; + if (&x && &y && &z) return 0;], gl_cv_socket_ipv4=yes, gl_cv_socket_ipv4=no)]) AC_MSG_RESULT($gl_cv_socket_ipv4) if test $gl_cv_socket_ipv4 = yes; then @@ -47,7 +48,8 @@ #ifdef HAVE_WINSOCK2_H #include <winsock2.h> #endif], -[int x = AF_INET6; struct in6_addr y; struct sockaddr_in6 z;], +[int x = AF_INET6; struct in6_addr y; struct sockaddr_in6 z; + if (&x && &y && &z) return 0;], gl_cv_socket_ipv6=yes, gl_cv_socket_ipv6=no)]) AC_MSG_RESULT($gl_cv_socket_ipv6) if test $gl_cv_socket_ipv6 = yes; then
Index: m4/fsusage.m4 =================================================================== RCS file: /cvsroot/gnulib/gnulib/m4/fsusage.m4,v retrieving revision 1.29 diff -u -r1.29 fsusage.m4 --- m4/fsusage.m4 7 Sep 2006 16:17:48 -0000 1.29 +++ m4/fsusage.m4 22 Sep 2006 03:13:42 -0000 @@ -242,7 +242,8 @@ #endif #include <sys/types.h> #include <sys/vfs.h>]], - [[struct statfs t; long c = *(t.f_spare);]])], + [[struct statfs t; long c = *(t.f_spare); + if (c) return 0;]])], [fu_cv_sys_truncating_statfs=yes], [fu_cv_sys_truncating_statfs=no])]) if test $fu_cv_sys_truncating_statfs = yes; then Index: m4/getdate.m4 =================================================================== RCS file: /cvsroot/gnulib/gnulib/m4/getdate.m4,v retrieving revision 1.11 diff -u -r1.11 getdate.m4 --- m4/getdate.m4 13 Sep 2006 20:14:57 -0000 1.11 +++ m4/getdate.m4 22 Sep 2006 03:13:42 -0000 @@ -1,4 +1,4 @@ -# getdate.m4 serial 11 +# getdate.m4 serial 12 dnl Copyright (C) 2002, 2003, 2004, 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, @@ -8,7 +8,8 @@ [ AC_CACHE_CHECK([for compound literals], gl_cv_compound_literals, [AC_TRY_COMPILE([struct s { int i, j; }; struct s s = (struct s) { 1, 2 };], - [struct s t = (struct s) { 3, 4 };], + [struct s t = (struct s) { 3, 4 }; + if (t.i != 0) return 0;], gl_cv_compound_literals=yes, gl_cv_compound_literals=no)]) if test $gl_cv_compound_literals = yes; then Index: m4/jm-winsz1.m4 =================================================================== RCS file: /cvsroot/gnulib/gnulib/m4/jm-winsz1.m4,v retrieving revision 1.8 diff -u -r1.8 jm-winsz1.m4 --- m4/jm-winsz1.m4 23 Jan 2005 08:06:57 -0000 1.8 +++ m4/jm-winsz1.m4 22 Sep 2006 03:13:43 -0000 @@ -1,6 +1,6 @@ -#serial 8 +#serial 9 -# Copyright (C) 1996, 1999, 2001, 2002, 2004 Free Software Foundation, Inc. +# Copyright (C) 1996, 1999, 2001, 2002, 2004, 2006 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -30,13 +30,15 @@ jm_cv_sys_struct_winsize_needs_sys_ptem_h, [jm_cv_sys_struct_winsize_needs_sys_ptem_h=yes if test $ac_cv_sys_posix_termios = yes; then - AC_TRY_COMPILE([#include <termios.h>] - [struct winsize x;], + AC_TRY_COMPILE([#include <termios.h>], + [struct winsize x; + if (sizeof x > 0) return 0;], [jm_cv_sys_struct_winsize_needs_sys_ptem_h=no]) fi if test $jm_cv_sys_struct_winsize_needs_sys_ptem_h = yes; then AC_TRY_COMPILE([#include <sys/ptem.h>], - [struct winsize x;], + [struct winsize x; + if (sizeof x > 0) return 0;], [], [jm_cv_sys_struct_winsize_needs_sys_ptem_h=no]) fi]) if test $jm_cv_sys_struct_winsize_needs_sys_ptem_h = yes; then Index: m4/link-follow.m4 =================================================================== RCS file: /cvsroot/gnulib/gnulib/m4/link-follow.m4,v retrieving revision 1.12 diff -u -r1.12 link-follow.m4 --- m4/link-follow.m4 9 Jul 2006 01:31:04 -0000 1.12 +++ m4/link-follow.m4 22 Sep 2006 03:13:43 -0000 @@ -1,4 +1,4 @@ -#serial 8 +#serial 9 dnl Run a program to determine whether link(2) follows symlinks. dnl Set LINK_FOLLOWS_SYMLINKS accordingly. @@ -20,6 +20,7 @@ # include <sys/types.h> # include <sys/stat.h> # include <unistd.h> +# include <stdlib.h> # define SAME_INODE(Stat_buf_1, Stat_buf_2) \ ((Stat_buf_1).st_ino == (Stat_buf_2).st_ino \ Index: m4/ls-mntd-fs.m4 =================================================================== RCS file: /cvsroot/gnulib/gnulib/m4/ls-mntd-fs.m4,v retrieving revision 1.35 diff -u -r1.35 ls-mntd-fs.m4 --- m4/ls-mntd-fs.m4 8 Sep 2006 09:10:57 -0000 1.35 +++ m4/ls-mntd-fs.m4 22 Sep 2006 03:13:43 -0000 @@ -141,7 +141,8 @@ # endif #endif ], - [ struct mntent *mnt = 0; char *table = MOUNTED; ], + [ struct mntent *mnt = 0; char *table = MOUNTED; + if (sizeof mnt > 0 && table > 0) return 0;], fu_cv_sys_mounted_getmntent1=yes, fu_cv_sys_mounted_getmntent1=no)]) AC_MSG_RESULT($fu_cv_sys_mounted_getmntent1) Index: m4/mkdir-slash.m4 =================================================================== RCS file: /cvsroot/gnulib/gnulib/m4/mkdir-slash.m4,v retrieving revision 1.6 diff -u -r1.6 mkdir-slash.m4 --- m4/mkdir-slash.m4 23 Jan 2005 08:06:57 -0000 1.6 +++ m4/mkdir-slash.m4 22 Sep 2006 03:13:43 -0000 @@ -1,6 +1,6 @@ -#serial 4 +#serial 6 -# Copyright (C) 2001, 2003, 2004 Free Software Foundation, Inc. +# Copyright (C) 2001, 2003, 2004, 2006 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -19,6 +19,9 @@ # include <sys/types.h> # include <sys/stat.h> # include <stdlib.h> +# ifdef HAVE_UNISTD_H +# include <unistd.h> +# endif int main () { rmdir ("confdir-slash"); Index: m4/physmem.m4 =================================================================== RCS file: /cvsroot/gnulib/gnulib/m4/physmem.m4,v retrieving revision 1.6 diff -u -r1.6 physmem.m4 --- m4/physmem.m4 21 Aug 2006 21:46:31 -0000 1.6 +++ m4/physmem.m4 22 Sep 2006 03:13:43 -0000 @@ -1,4 +1,4 @@ -# physmem.m4 serial 6 +# physmem.m4 serial 7 dnl Copyright (C) 2002, 2003, 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, @@ -12,7 +12,8 @@ [AC_LINK_IFELSE([AC_LANG_PROGRAM( [[#include <sys/systemcfg.h> ]], - [double x = _system_configuration.physmem;])], + [double x = _system_configuration.physmem; + if (x > 0.0) return 0;])], [gl_cv_var__system_configuration=yes], [gl_cv_var__system_configuration=no])]) Index: m4/putenv.m4 =================================================================== RCS file: /cvsroot/gnulib/gnulib/m4/putenv.m4,v retrieving revision 1.17 diff -u -r1.17 putenv.m4 --- m4/putenv.m4 24 Apr 2006 07:35:24 -0000 1.17 +++ m4/putenv.m4 22 Sep 2006 03:13:43 -0000 @@ -1,4 +1,4 @@ -# putenv.m4 serial 11 +# putenv.m4 serial 12 dnl Copyright (C) 2002, 2003, 2004, 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, @@ -11,25 +11,21 @@ AC_DEFUN([gl_FUNC_PUTENV], [AC_CACHE_CHECK([for SVID conformant putenv], jm_cv_func_svid_putenv, - [AC_TRY_RUN([ - int - main () - { - /* Put it in env. */ - if (putenv ("CONFTEST_putenv=val")) - return 1; + [AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],[ + /* Put it in env. */ + if (putenv ("CONFTEST_putenv=val")) + return 1; - /* Try to remove it. */ - if (putenv ("CONFTEST_putenv")) - return 1; + /* Try to remove it. */ + if (putenv ("CONFTEST_putenv")) + return 1; - /* Make sure it was deleted. */ - if (getenv ("CONFTEST_putenv") != 0) - return 1; + /* Make sure it was deleted. */ + if (getenv ("CONFTEST_putenv") != 0) + return 1; - return 0; - } - ], + return 0; + ])], jm_cv_func_svid_putenv=yes, jm_cv_func_svid_putenv=no, dnl When crosscompiling, assume putenv is broken. Index: m4/readutmp.m4 =================================================================== RCS file: /cvsroot/gnulib/gnulib/m4/readutmp.m4,v retrieving revision 1.13 diff -u -r1.13 readutmp.m4 --- m4/readutmp.m4 22 Aug 2006 17:34:55 -0000 1.13 +++ m4/readutmp.m4 22 Sep 2006 03:13:43 -0000 @@ -1,4 +1,4 @@ -# readutmp.m4 serial 11 +# readutmp.m4 serial 12 dnl Copyright (C) 2002, 2003, 2004, 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, @@ -6,6 +6,9 @@ AC_DEFUN([gl_READUTMP], [ + dnl Persuade utmpx.h to declare utmpxname + AC_REQUIRE([AC_GNU_SOURCE]) + AC_CHECK_HEADERS_ONCE(utmp.h utmpx.h) if test $ac_cv_header_utmp_h = yes || test $ac_cv_header_utmpx_h = yes; then AC_LIBOBJ([readutmp]) Index: m4/rmdir-errno.m4 =================================================================== RCS file: /cvsroot/gnulib/gnulib/m4/rmdir-errno.m4,v retrieving revision 1.7 diff -u -r1.7 rmdir-errno.m4 --- m4/rmdir-errno.m4 17 Jun 2006 19:26:19 -0000 1.7 +++ m4/rmdir-errno.m4 22 Sep 2006 03:13:43 -0000 @@ -1,4 +1,4 @@ -#serial 7 +#serial 8 # Copyright (C) 2000, 2001, 2005, 2006 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation @@ -21,6 +21,9 @@ AC_TRY_RUN([ #include <stdio.h> #include <errno.h> +#ifdef HAVE_UNISTD_H +# include <unistd.h> +#endif int main () { FILE *s; Index: m4/time_r.m4 =================================================================== RCS file: /cvsroot/gnulib/gnulib/m4/time_r.m4,v retrieving revision 1.5 diff -u -r1.5 time_r.m4 --- m4/time_r.m4 21 Aug 2006 21:46:31 -0000 1.5 +++ m4/time_r.m4 22 Sep 2006 03:13:43 -0000 @@ -19,7 +19,8 @@ [/* We don't need to append 'restrict's to the argument types, even though the POSIX signature has the 'restrict's, since C99 says they can't affect type compatibility. */ - struct tm * (*ptr) (time_t const *, struct tm *) = localtime_r;], + struct tm * (*ptr) (time_t const *, struct tm *) = localtime_r; + if (ptr) return 0;], [gl_cv_time_r_posix=yes], [gl_cv_time_r_posix=no])]) if test $gl_cv_time_r_posix = yes; then
Index: m4/lock.m4 =================================================================== RCS file: /cvsroot/gnulib/gnulib/m4/lock.m4,v retrieving revision 1.6 diff -u -r1.6 lock.m4 --- m4/lock.m4 23 Aug 2006 12:11:02 -0000 1.6 +++ m4/lock.m4 22 Sep 2006 04:13:20 -0000 @@ -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 @@ error "No, in FreeBSD 4.0 recursive mutexes actually don't work." #else int x = (int)PTHREAD_MUTEX_RECURSIVE; +if (x == 0) return 0; #endif], [AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE], 1, [Define if the <pthread.h> defines PTHREAD_MUTEX_RECURSIVE.])]) Index: m4/mbswidth.m4 =================================================================== RCS file: /cvsroot/gnulib/gnulib/m4/mbswidth.m4,v retrieving revision 1.15 diff -u -r1.15 mbswidth.m4 --- m4/mbswidth.m4 28 Jun 2006 13:10:13 -0000 1.15 +++ m4/mbswidth.m4 22 Sep 2006 04:13:39 -0000 @@ -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 @@ #endif ], [ char *p = (char *) mbswidth; + if (p) return 0; ], ac_cv_have_decl_mbswidth=yes, ac_cv_have_decl_mbswidth=no)]) if test $ac_cv_have_decl_mbswidth = yes; then ac_val=1 Index: m4/signed.m4 =================================================================== RCS file: /cvsroot/gnulib/gnulib/m4/signed.m4,v retrieving revision 1.4 diff -u -r1.4 signed.m4 --- m4/signed.m4 18 Jan 2005 13:07:56 -0000 1.4 +++ m4/signed.m4 22 Sep 2006 03:13:43 -0000 @@ -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 (gettext-0.10.40) +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 @@ 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 = 1; + if (x) return 0;], 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.]) Index: m4/stpncpy.m4 =================================================================== RCS file: /cvsroot/gnulib/gnulib/m4/stpncpy.m4,v retrieving revision 1.6 diff -u -r1.6 stpncpy.m4 --- m4/stpncpy.m4 2 Mar 2005 17:19:45 -0000 1.6 +++ m4/stpncpy.m4 22 Sep 2006 03:13:43 -0000 @@ -1,5 +1,5 @@ -# stpncpy.m4 serial 3 -dnl Copyright (C) 2002-2003, 2005 Free Software Foundation, Inc. +# stpncpy.m4 serial 4 +dnl Copyright (C) 2002-2003, 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, dnl with or without modifications, as long as this notice is preserved. @@ -22,6 +22,7 @@ AC_CACHE_CHECK([for working stpncpy], gl_cv_func_stpncpy, [ AC_TRY_RUN([ #include <stdlib.h> +#include <string.h> extern char *stpncpy (char *dest, const char *src, size_t n); int main () { const char *src = "Hello"; Index: m4/vasprintf.m4 =================================================================== RCS file: /cvsroot/gnulib/gnulib/m4/vasprintf.m4,v retrieving revision 1.2 diff -u -r1.2 vasprintf.m4 --- m4/vasprintf.m4 18 Jan 2005 13:07:56 -0000 1.2 +++ m4/vasprintf.m4 22 Sep 2006 03:13:43 -0000 @@ -1,11 +1,14 @@ -# 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. AC_DEFUN([gl_FUNC_VASPRINTF], [ + dnl convince stdlib.h to declare vasprintf + AC_REQUIRE([AC_GNU_SOURCE]) + AC_REPLACE_FUNCS(vasprintf) if test $ac_cv_func_vasprintf = no; then AC_LIBOBJ(asprintf)