]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* aclang.m4 (AC_C_CHAR_UNSIGNED): Use the new compiler-test
authorAkim Demaille <akim@epita.fr>
Mon, 5 Jun 2000 10:00:41 +0000 (10:00 +0000)
committerAkim Demaille <akim@epita.fr>
Mon, 5 Jun 2000 10:00:41 +0000 (10:00 +0000)
technology so that we can do the test via compilations only.  Also
use (char) -1 instead of (char) 255 to check if char is unsigned.

ChangeLog
TODO
aclang.m4
lib/autoconf/c.m4
lib/autoconf/fortran.m4
lib/autoconf/lang.m4

index a4d1d9f36df22880433cd0586cb78d47b45ea91a..3eb9e793c1be6ea29b6b4bb0ce32507d828d5344 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2000-06-05  Steven G. Johnson  <stevenj@alum.mit.edu>
+
+       * aclang.m4 (AC_C_CHAR_UNSIGNED): Use the new compiler-test
+       technology so that we can do the test via compilations only.  Also
+       use (char) -1 instead of (char) 255 to check if char is unsigned.
+
 2000-05-28  Jim Meyering  <meyering@lucent.com>
 
        * acspecific.m4 (AC_FUNC_STRERROR_R): Call strerror_r with 2nd arg
diff --git a/TODO b/TODO
index 3beda11212c3aece5be68b77993c16b1650bb9dd..39cfb1742ff794aa415e4a9ba0f254a46b4c1559 100644 (file)
--- a/TODO
+++ b/TODO
@@ -105,9 +105,6 @@ We *need* it.
 ** More macros from Jim
 Those related to *_SLASH_*.
 
-** AC_C_CHAR_UNSIGNED
-Use the new technology to read compiler's characteristics.
-
 ** AC_FUNC_GETLOADAVG
 We must find a solution for this macro which needs to find
 `getloadavg.c'.
index c4685362c71575e0b3f5494a55a3fa9b05ac6d39..737b346c63189c6c96018ac75ab86348112192ba 100644 (file)
--- a/aclang.m4
+++ b/aclang.m4
@@ -1040,26 +1040,9 @@ AC_DEFUN([AC_C_CHAR_UNSIGNED],
 # undef __CHAR_UNSIGNED__
 #endif])dnl
 AC_CACHE_CHECK(whether char is unsigned, ac_cv_c_char_unsigned,
-[if test "$GCC" = yes; then
-  # GCC predefines this symbol on systems where it applies.
-AC_EGREP_CPP(yes,
-[#ifdef __CHAR_UNSIGNED__
-  yes
-#endif
-], ac_cv_c_char_unsigned=yes, ac_cv_c_char_unsigned=no)
-else
-AC_TRY_RUN(
-[/* volatile prevents gcc2 from optimizing the test away on sparcs.  */
-#if !defined(__STDC__) || __STDC__ != 1
-# define volatile
-#endif
-int
-main()
-{
-  volatile char c = 255;
-  exit(c < 0);
-}], ac_cv_c_char_unsigned=yes, ac_cv_c_char_unsigned=no)
-fi])
+[AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([AC_INCLUDES_DEFAULT([])],
+                                             [((char) -1) < 0])],
+                   ac_cv_c_char_unsigned=no, ac_cv_c_char_unsigned=yes)])
 if test $ac_cv_c_char_unsigned = yes && test "$GCC" != yes; then
   AC_DEFINE(__CHAR_UNSIGNED__)
 fi
index c4685362c71575e0b3f5494a55a3fa9b05ac6d39..737b346c63189c6c96018ac75ab86348112192ba 100644 (file)
@@ -1040,26 +1040,9 @@ AC_DEFUN([AC_C_CHAR_UNSIGNED],
 # undef __CHAR_UNSIGNED__
 #endif])dnl
 AC_CACHE_CHECK(whether char is unsigned, ac_cv_c_char_unsigned,
-[if test "$GCC" = yes; then
-  # GCC predefines this symbol on systems where it applies.
-AC_EGREP_CPP(yes,
-[#ifdef __CHAR_UNSIGNED__
-  yes
-#endif
-], ac_cv_c_char_unsigned=yes, ac_cv_c_char_unsigned=no)
-else
-AC_TRY_RUN(
-[/* volatile prevents gcc2 from optimizing the test away on sparcs.  */
-#if !defined(__STDC__) || __STDC__ != 1
-# define volatile
-#endif
-int
-main()
-{
-  volatile char c = 255;
-  exit(c < 0);
-}], ac_cv_c_char_unsigned=yes, ac_cv_c_char_unsigned=no)
-fi])
+[AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([AC_INCLUDES_DEFAULT([])],
+                                             [((char) -1) < 0])],
+                   ac_cv_c_char_unsigned=no, ac_cv_c_char_unsigned=yes)])
 if test $ac_cv_c_char_unsigned = yes && test "$GCC" != yes; then
   AC_DEFINE(__CHAR_UNSIGNED__)
 fi
index c4685362c71575e0b3f5494a55a3fa9b05ac6d39..737b346c63189c6c96018ac75ab86348112192ba 100644 (file)
@@ -1040,26 +1040,9 @@ AC_DEFUN([AC_C_CHAR_UNSIGNED],
 # undef __CHAR_UNSIGNED__
 #endif])dnl
 AC_CACHE_CHECK(whether char is unsigned, ac_cv_c_char_unsigned,
-[if test "$GCC" = yes; then
-  # GCC predefines this symbol on systems where it applies.
-AC_EGREP_CPP(yes,
-[#ifdef __CHAR_UNSIGNED__
-  yes
-#endif
-], ac_cv_c_char_unsigned=yes, ac_cv_c_char_unsigned=no)
-else
-AC_TRY_RUN(
-[/* volatile prevents gcc2 from optimizing the test away on sparcs.  */
-#if !defined(__STDC__) || __STDC__ != 1
-# define volatile
-#endif
-int
-main()
-{
-  volatile char c = 255;
-  exit(c < 0);
-}], ac_cv_c_char_unsigned=yes, ac_cv_c_char_unsigned=no)
-fi])
+[AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([AC_INCLUDES_DEFAULT([])],
+                                             [((char) -1) < 0])],
+                   ac_cv_c_char_unsigned=no, ac_cv_c_char_unsigned=yes)])
 if test $ac_cv_c_char_unsigned = yes && test "$GCC" != yes; then
   AC_DEFINE(__CHAR_UNSIGNED__)
 fi
index c4685362c71575e0b3f5494a55a3fa9b05ac6d39..737b346c63189c6c96018ac75ab86348112192ba 100644 (file)
@@ -1040,26 +1040,9 @@ AC_DEFUN([AC_C_CHAR_UNSIGNED],
 # undef __CHAR_UNSIGNED__
 #endif])dnl
 AC_CACHE_CHECK(whether char is unsigned, ac_cv_c_char_unsigned,
-[if test "$GCC" = yes; then
-  # GCC predefines this symbol on systems where it applies.
-AC_EGREP_CPP(yes,
-[#ifdef __CHAR_UNSIGNED__
-  yes
-#endif
-], ac_cv_c_char_unsigned=yes, ac_cv_c_char_unsigned=no)
-else
-AC_TRY_RUN(
-[/* volatile prevents gcc2 from optimizing the test away on sparcs.  */
-#if !defined(__STDC__) || __STDC__ != 1
-# define volatile
-#endif
-int
-main()
-{
-  volatile char c = 255;
-  exit(c < 0);
-}], ac_cv_c_char_unsigned=yes, ac_cv_c_char_unsigned=no)
-fi])
+[AC_COMPILE_IFELSE([AC_LANG_BOOL_COMPILE_TRY([AC_INCLUDES_DEFAULT([])],
+                                             [((char) -1) < 0])],
+                   ac_cv_c_char_unsigned=no, ac_cv_c_char_unsigned=yes)])
 if test $ac_cv_c_char_unsigned = yes && test "$GCC" != yes; then
   AC_DEFINE(__CHAR_UNSIGNED__)
 fi