From: Francesco Chemolli Date: Sun, 29 May 2011 06:45:37 +0000 (-0600) Subject: Portability Fix: always-true comparison in ICAP for some 32-bit platforms X-Git-Tag: SQUID_3_1_12_2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cd5bf3179dc8b104f6bbc16ac02e54dc78f24a21;p=thirdparty%2Fsquid.git Portability Fix: always-true comparison in ICAP for some 32-bit platforms --- 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); }