]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* lib/autoconf/c.m4 (AC_C_CONST, AC_C_VOLATILE): Avoid warnings
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Tue, 11 Apr 2006 16:02:01 +0000 (16:02 +0000)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Tue, 11 Apr 2006 16:02:01 +0000 (16:02 +0000)
from gcc.

ChangeLog
lib/autoconf/c.m4

index c3406dce47e0c35733e75a3a98633263345743e9..a41bbcbaad016354290e338508243882ae4f9d1f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-04-10  Eric Blake  <ebb9@byu.net>
+
+       * lib/autoconf/c.m4 (AC_C_CONST, AC_C_VOLATILE): Avoid warnings
+       from gcc.
+
 2006-04-10  Stepan Kasal  <kasal@ucw.cz>
 
        * tests/mktests.sh: Use "trap '' 0", not "trap 0".  Do not touch
index 64d6b107925ceaa4439f848c03db605acff0a517..cd51a0eca48b1da96987cf3a2cffa224ed3a8366 100644 (file)
@@ -1425,6 +1425,7 @@ AC_DEFUN([AC_C_CONST],
     char const *s = 0 ? (char *) 0 : (char const *) 0;
 
     *t++ = 0;
+    if (s) return 0;
   }
   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
     int x[] = {25, 17};
@@ -1443,7 +1444,9 @@ AC_DEFUN([AC_C_CONST],
   }
   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
     const int foo = 10;
+    if (!foo) return 0;
   }
+  return !x[0] && !zero.x;
 #endif
 ]])],
                   [ac_cv_c_const=yes],
@@ -1511,7 +1514,8 @@ AC_DEFUN([AC_C_VOLATILE],
 [AC_CACHE_CHECK([for working volatile], ac_cv_c_volatile,
 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [
 volatile int x;
-int * volatile y;])],
+int * volatile y = (int *) 0;
+return !x && !y;])],
                   [ac_cv_c_volatile=yes],
                   [ac_cv_c_volatile=no])])
 if test $ac_cv_c_volatile = no; then