From cd5bf3179dc8b104f6bbc16ac02e54dc78f24a21 Mon Sep 17 00:00:00 2001 From: Francesco Chemolli Date: Sun, 29 May 2011 00:45:37 -0600 Subject: [PATCH] Portability Fix: always-true comparison in ICAP for some 32-bit platforms --- configure.ac | 1 + src/adaptation/icap/ModXact.cc | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/configure.ac b/configure.ac index d129c7563c..df4e57eea3 100644 --- a/configure.ac +++ b/configure.ac @@ -2593,6 +2593,7 @@ AC_CHECK_TYPE(uint64_t,[ ],,SQUID_DEFAULT_INCLUDES) #need the define for overflow checks AC_CHECK_SIZEOF(off_t) +AC_CHECK_SIZEOF(size_t) dnl On Solaris 9 x86, gcc may includes a "fixed" set of old system include files dnl that is incompatible with the updated Solaris header files. diff --git a/src/adaptation/icap/ModXact.cc b/src/adaptation/icap/ModXact.cc index 5fffd340e2..c719cbd045 100644 --- a/src/adaptation/icap/ModXact.cc +++ b/src/adaptation/icap/ModXact.cc @@ -1620,6 +1620,10 @@ void Adaptation::Icap::VirginBodyAct::disable() void Adaptation::Icap::VirginBodyAct::progress(size_t size) { Must(active()); +#if SIZEOF_SIZE_T > 4 + /* always true for smaller size_t's */ + Must(static_cast(size) >= 0); +#endif theStart += static_cast(size); } -- 2.47.2