From: Ralf Wildenhues Date: Tue, 11 Apr 2006 16:02:01 +0000 (+0000) Subject: * lib/autoconf/c.m4 (AC_C_CONST, AC_C_VOLATILE): Avoid warnings X-Git-Tag: AUTOCONF-2.59c~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4ba7445703b9925a05c596e3e08f1d09b341fcc1;p=thirdparty%2Fautoconf.git * lib/autoconf/c.m4 (AC_C_CONST, AC_C_VOLATILE): Avoid warnings from gcc. --- diff --git a/ChangeLog b/ChangeLog index c3406dce4..a41bbcbaa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-04-10 Eric Blake + + * lib/autoconf/c.m4 (AC_C_CONST, AC_C_VOLATILE): Avoid warnings + from gcc. + 2006-04-10 Stepan Kasal * tests/mktests.sh: Use "trap '' 0", not "trap 0". Do not touch diff --git a/lib/autoconf/c.m4 b/lib/autoconf/c.m4 index 64d6b1079..cd51a0eca 100644 --- a/lib/autoconf/c.m4 +++ b/lib/autoconf/c.m4 @@ -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