[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
avoid some more warnings in tests
From: |
Ralf Wildenhues |
Subject: |
avoid some more warnings in tests |
Date: |
Fri, 22 Sep 2006 06:34:12 +0200 |
User-agent: |
Mutt/1.5.13 (2006-08-11) |
OK to apply? (Is obstack.h guaranteed to define struct obstack, and not
only declare it?)
This fell out of some gnulib testing.
Cheers,
Ralf
* lib/autoconf/functions.m4 (AC_FUNC_OBSTACK): Avoid `gcc -Wall'
warnings (uninitialized value).
(AC_FUNC_UTIME_NULL): Likewise, test for and include <utime.h> if
present.
* lib/autoconf/types.m4 (AC_TYPE_LONG_LONG_INT): Likewise, add
parentheses.
(AC_STRUCT_TM): Likewise, avoid unused variables.
Index: lib/autoconf/functions.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/functions.m4,v
retrieving revision 1.109
diff -u -r1.109 functions.m4
--- lib/autoconf/functions.m4 15 Sep 2006 14:53:43 -0000 1.109
+++ lib/autoconf/functions.m4 22 Sep 2006 03:30:58 -0000
@@ -1340,7 +1340,7 @@
AC_CACHE_CHECK([for obstacks], ac_cv_func_obstack,
[AC_LINK_IFELSE(
[AC_LANG_PROGRAM(address@hidden:@include "obstack.h"]],
- [[struct obstack *mem; obstack_free(mem,(char *) 0)]])],
+ [[struct obstack mem; obstack_free(&mem,(char *) 0)]])],
[ac_cv_func_obstack=yes],
[ac_cv_func_obstack=no])])
if test $ac_cv_func_obstack = yes; then
@@ -1758,10 +1758,14 @@
# ------------------
AN_FUNCTION([utime], [AC_FUNC_UTIME_NULL])
AC_DEFUN([AC_FUNC_UTIME_NULL],
-[AC_CACHE_CHECK(whether utime accepts a null argument, ac_cv_func_utime_null,
+[AC_CHECK_HEADERS_ONCE(utime.h)
+AC_CACHE_CHECK(whether utime accepts a null argument, ac_cv_func_utime_null,
[rm -f conftest.data; >conftest.data
# Sequent interprets utime(file, 0) to mean use start of epoch. Wrong.
-AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
+AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT
+ #ifdef HAVE_UTIME_H
+ # include <utime.h>
+ #endif],
[[struct stat s, t;
return ! (stat ("conftest.data", &s) == 0
&& utime ("conftest.data", 0) == 0
Index: lib/autoconf/types.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/autoconf/types.m4,v
retrieving revision 1.44
diff -u -r1.44 types.m4
--- lib/autoconf/types.m4 2 Sep 2006 05:37:08 -0000 1.44
+++ lib/autoconf/types.m4 22 Sep 2006 03:30:58 -0000
@@ -479,7 +479,7 @@
? 1 : -1)];
int i = 63;]],
[[long long int llmax = 9223372036854775807ll;
- return (ll << 63 | ll >> 63 | ll < i | ll > i
+ return (ll << 63 | ll >> 63 | (ll < i) | (ll > i)
| llmax / ll | llmax % ll);]])],
[ac_cv_type_long_long_int=yes],
[ac_cv_type_long_long_int=no])])
@@ -919,7 +919,8 @@
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/types.h>
#include <time.h>
],
- [struct tm *tp; tp->tm_sec;])],
+ [struct tm tp;
+ if (sizeof tp.tm_sec != 0) return 0;])],
[ac_cv_struct_tm=time.h],
[ac_cv_struct_tm=sys/time.h])])
if test $ac_cv_struct_tm = sys/time.h; then
- avoid some more warnings in tests,
Ralf Wildenhues <=