Re: XMIN(size_t, ssize_t) ?

From: Adrian Chadd <adrian_at_creative.net.au>
Date: Fri, 16 May 2008 05:25:00 +0800

On Thu, May 15, 2008, Alex Rousskov wrote:

> > .. which explains the strange bugs that someone is seeing with Squid-2.HEAD
> > and the store update stuff.
>
> Interesting bug. FWIW, it looks like g++ automatically detects the above
> error and says:
> warning: comparison between signed and unsigned integer expressions

> This probably means there are no such problems in Squid3 code except for
> explicit casts. I do not know why gcc does not warn about these
> problems.

Yeah, I was expecting gcc to similarly warn - I swear I've seen it warn
before on such nonsense.

> P.S. It looks like Squid3 XMIN replacement, being more conservative than
> perhaps necessary, does not even let the above compile:
> error: no matching function for call to ???XMIN(size_t&, ssize_t&)???

Oh, how I wish that plain C just had the ability to create multiple functions
with differing prototypes like that..

Adrian

-- 
- Xenion - http://www.xenion.com.au/ - VPS Hosting - Commercial Squid Support -
- $25/pm entry-level VPSes w/ capped bandwidth charges available in WA -
Received on Thu May 15 2008 - 21:24:45 MDT

This archive was generated by hypermail 2.2.0 : Tue Aug 05 2008 - 01:06:35 MDT