]> git.lizzy.rs Git - zlib.git/blobdiff - configure
Avoid undefined behaviors of memcpy() in gz*printf().
[zlib.git] / configure
index c4fee2e2e0aa625cb5e2cdc2e2382e6f212bef5d..f4127954c9833353e6547379f741be98b0f2b337 100755 (executable)
--- a/configure
+++ b/configure
@@ -175,6 +175,7 @@ case "$cc" in
 esac
 case `$cc -v 2>&1` in
   *gcc*) gcc=1 ;;
+  *clang*) gcc=1 ;;
 esac
 
 show $cc -c $test.c
@@ -193,9 +194,9 @@ if test "$gcc" -eq 1 && ($cc -c $test.c) >> configure.log 2>&1; then
   fi
   if test "$warn" -eq 1; then
     if test "$zconst" -eq 1; then
-      CFLAGS="${CFLAGS} -Wall -Wextra -Wcast-qual -pedantic -DZLIB_CONST"
+      CFLAGS="${CFLAGS} -Wall -Wextra -Wcast-qual -pedantic -DZLIB_CONST -fsanitize=address"
     else
-      CFLAGS="${CFLAGS} -Wall -Wextra -pedantic"
+      CFLAGS="${CFLAGS} -Wall -Wextra -pedantic -fsanitize=address"
     fi
   fi
   if test $debug -eq 1; then
@@ -464,23 +465,8 @@ fi
 
 echo >> configure.log
 
-# check for ssize_t
-cat > $test.c <<EOF
-#include <sys/types.h>
-ssize_t dummy = 0;
-EOF
-if try $CC -c $CFLAGS $test.c; then
-  echo "Checking for ssize_t... Yes." | tee -a configure.log
-  need_ssizet=0
-else
-  echo "Checking for ssize_t... No." | tee -a configure.log
-  need_ssizet=1
-fi
-
-echo >> configure.log
-
 # find the size_t integer type, if needed
-if test $need_sizet -eq 1 -o $need_ssizet -eq 1; then
+if test $need_sizet -eq 1; then
   cat > $test.c <<EOF
 long long dummy = 0;
 EOF
@@ -520,11 +506,6 @@ if test $need_sizet -eq 1; then
   SFLAGS="${SFLAGS} -DNO_SIZE_T=${sizet}"
 fi
 
-if test $need_ssizet -eq 1; then
-  CFLAGS="${CFLAGS} -DNO_SSIZE_T=${sizet}"
-  SFLAGS="${SFLAGS} -DNO_SSIZE_T=${sizet}"
-fi
-
 echo >> configure.log
 
 # check for large file support, and if none, check for fseeko()