summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorWayne Davison <wayne@opencoder.net>2022-06-18 10:19:57 -0700
committerWayne Davison <wayne@opencoder.net>2022-06-18 10:23:32 -0700
commit4f741addbd5fd59de2c2655e5a044d6c2fe44aa5 (patch)
treecbc41c9cb8733bfd22b174b97486c5eedc2590c8 /configure.ac
parent355b81d8bce3d91c4bc5e86e67d3fdb225eef99e (diff)
downloadrsync-4f741addbd5fd59de2c2655e5a044d6c2fe44aa5.tar.gz
Fix configure's "signed char" check
When pedantic errors are enabled, SIGNED_CHAR_OK was no longer being set correctly. This would cause the checksum code to use "char" instead of "signed char", and if the default for a "char" was unsigned, the checksum code would fail to compute the right hash values. Fixes bug #317.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac10
1 files changed, 3 insertions, 7 deletions
diff --git a/configure.ac b/configure.ac
index 93f222dd..37dbb18a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1066,11 +1066,7 @@ elif test x"$ac_cv_header_popt_h" != x"yes"; then
with_included_popt=yes
fi
-# Some arm systems compute the checksums wrong when -pedantic-errors is set, so we
-# limit this to x86 for the moment (since this should ensure that the main purpose
-# of finding a static-list overflow will still occur on a large number of hosts).
-case "$GCC,$host_cpu" in
-yes,x86_64|yes,amd64)
+if test x"$GCC" = x"yes"; then
if test x"$with_included_popt" != x"yes"; then
# Turn pedantic warnings into errors to ensure an array-init overflow is an error.
CFLAGS="$CFLAGS -pedantic-errors"
@@ -1083,7 +1079,7 @@ yes,x86_64|yes,amd64)
*-Wpedantic*) CFLAGS="$CFLAGS -pedantic-errors -Wno-pedantic" ;;
esac
fi
-esac
+fi
AC_MSG_CHECKING([whether to use included libpopt])
if test x"$with_included_popt" = x"yes"; then
@@ -1121,7 +1117,7 @@ else
fi
AC_CACHE_CHECK([for unsigned char],rsync_cv_SIGNED_CHAR_OK,[
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[signed char *s = ""]])],[rsync_cv_SIGNED_CHAR_OK=yes],[rsync_cv_SIGNED_CHAR_OK=no])])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[signed char *s = (signed char *)""]])],[rsync_cv_SIGNED_CHAR_OK=yes],[rsync_cv_SIGNED_CHAR_OK=no])])
if test x"$rsync_cv_SIGNED_CHAR_OK" = x"yes"; then
AC_DEFINE(SIGNED_CHAR_OK, 1, [Define to 1 if "signed char" is a valid type])
fi