]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* acgeneral.m4 (AC_CHECK_TYPE_INTERNAL): Instead of defining an
authorAkim Demaille <akim@epita.fr>
Mon, 7 Feb 2000 16:52:09 +0000 (16:52 +0000)
committerAkim Demaille <akim@epita.fr>
Mon, 7 Feb 2000 16:52:09 +0000 (16:52 +0000)
unused pointer to the type $1, use
if (($1 *) 0) return 0;
to avoid warnings from the compiler.
From Paul Eggert.

ChangeLog
acgeneral.m4
lib/autoconf/general.m4

index ebad940025febaef347c1b63ec23f4571e2a6830..8c5ebb696e0718faaf3f7f42b4d56a5b9d3b09b2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2000-02-07  Akim Demaille  <akim@epita.fr>
+
+       * acgeneral.m4 (AC_CHECK_TYPE_INTERNAL): Instead of defining an
+       unused pointer to the type $1, use
+       if (($1 *) 0) return 0;
+       to avoid warnings from the compiler.
+       From Paul Eggert.
+
 2000-02-07  Akim Demaille  <akim@epita.fr>
 
        * acgeneral.m4 (AC_INCLUDES_DEFAULT): Include sys/types.h
index 069ad7900c0bb29e270879d6bbff99a91c32674b..73d46a288291310455d52fac8b606cb11859ec77 100644 (file)
@@ -3126,7 +3126,9 @@ dnl ### Checking for types
 #        if (sizeof (TYPE))
 #
 # to `read' sizeof (to avoid warnings), while not depending on its type
-# (not necessarily size_t etc.).
+# (not necessarily size_t etc.).  Equally, instead of defining an unused
+# variable, we just use a cast to avoid warnings from the compiler.
+# Suggested by Paul Eggert.
 #
 # FIXME: This is *the* macro which ought to be named AC_CHECK_TYPE.
 AC_DEFUN(AC_CHECK_TYPE_INTERNAL,
@@ -3134,7 +3136,8 @@ AC_DEFUN(AC_CHECK_TYPE_INTERNAL,
 AC_VAR_PUSHDEF([ac_Type], [ac_cv_type_$1])dnl
 AC_CACHE_CHECK([for $1], ac_Type,
 [AC_TRY_COMPILE(AC_INCLUDES_DEFAULT([$4]),
-[$1 *foo;
+[if (($1 *) 0)
+  return 0;
 if (sizeof ($1))
   return 0;],
                 AC_VAR_SET(ac_Type, yes),
index 069ad7900c0bb29e270879d6bbff99a91c32674b..73d46a288291310455d52fac8b606cb11859ec77 100644 (file)
@@ -3126,7 +3126,9 @@ dnl ### Checking for types
 #        if (sizeof (TYPE))
 #
 # to `read' sizeof (to avoid warnings), while not depending on its type
-# (not necessarily size_t etc.).
+# (not necessarily size_t etc.).  Equally, instead of defining an unused
+# variable, we just use a cast to avoid warnings from the compiler.
+# Suggested by Paul Eggert.
 #
 # FIXME: This is *the* macro which ought to be named AC_CHECK_TYPE.
 AC_DEFUN(AC_CHECK_TYPE_INTERNAL,
@@ -3134,7 +3136,8 @@ AC_DEFUN(AC_CHECK_TYPE_INTERNAL,
 AC_VAR_PUSHDEF([ac_Type], [ac_cv_type_$1])dnl
 AC_CACHE_CHECK([for $1], ac_Type,
 [AC_TRY_COMPILE(AC_INCLUDES_DEFAULT([$4]),
-[$1 *foo;
+[if (($1 *) 0)
+  return 0;
 if (sizeof ($1))
   return 0;],
                 AC_VAR_SET(ac_Type, yes),