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.
# ------------------
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
[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