diff options
author | Zack Weinberg <zackw@panix.com> | 2020-11-30 10:49:35 -0500 |
---|---|---|
committer | Zack Weinberg <zackw@panix.com> | 2020-11-30 11:45:25 -0500 |
commit | 9e8bc1bffcd8a1de54b05b24717113263a45f0c5 (patch) | |
tree | f7bdbe04e4466000e72db82fc66769c67722f1dd /lib | |
parent | 0cfa111eba910a1467bc74b962a2356898284556 (diff) | |
download | autoconf-9e8bc1bffcd8a1de54b05b24717113263a45f0c5.tar.gz |
AC_C_CHAR_UNSIGNED: Remove check of $GCC.
On systems where plain ‘char’ is unsigned (e.g. AIX) we would define
__CHAR_UNSIGNED__ only when $GCC was not true at configure time.
If AC_LANG([C++]) has been in effect since the beginning of the
script (so AC_PROG_CC was never invoked), $GCC will be false
regardless; this causes an inconsistency between the C and C++
behaviors, even when both compilers are GNU.
The point of checking $GCC here is that GCC has command line options
to override the signedness of plain ‘char’, and it predefines
__CHAR_UNSIGNED__ to indicate what the signedness actually is.
We don’t want config.h to override that. However, there is already
a special autoheader template for __CHAR_UNSIGNED__ that prevents it
being redefined if it’s defined already, so checking $GCC at
configure time is redundant and can safely be removed.
* lib/autoconf/c.m4 (AC_C_CHAR_UNSIGNED): Do not make result depend on
value of $GCC. Adjust commentary.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/autoconf/c.m4 | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/autoconf/c.m4 b/lib/autoconf/c.m4 index a31d2d33..af1e1a71 100644 --- a/lib/autoconf/c.m4 +++ b/lib/autoconf/c.m4 @@ -1536,7 +1536,8 @@ AU_DEFUN([AC_C_CROSS], []) # ------------------ AC_DEFUN([AC_C_CHAR_UNSIGNED], [AH_VERBATIM([__CHAR_UNSIGNED__], -[/* Define to 1 if type `char' is unsigned and you are not using gcc. */ +[/* Define to 1 if type `char' is unsigned and your compiler does not + predefine this macro. */ #ifndef __CHAR_UNSIGNED__ # undef __CHAR_UNSIGNED__ #endif])dnl @@ -1544,7 +1545,7 @@ AC_CACHE_CHECK(whether char is unsigned, ac_cv_c_char_unsigned, [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 +if test $ac_cv_c_char_unsigned = yes; then AC_DEFINE(__CHAR_UNSIGNED__) fi ])# AC_C_CHAR_UNSIGNED |