r2016 - trunk/varnish-cache/bin/varnishd

Poul-Henning Kamp phk at phk.freebsd.dk
Tue Oct 16 14:51:21 CEST 2007

In message <ujrlka36x9q.fsf at false.linpro.no>, =?iso-8859-1?Q?Dag-Erling_Sm=F8rg
rav?= writes:
>phk at projects.linpro.no writes:
>> Log:
>> When we take the difference between two pointers, the result is technical=
>> signed.  pdiff() makes sure we never get a negative value.
>I don't understand the need for pdiff.  If it is only to silence
>Flexelint, then I would suggest that Flexelint is broken.

Passing strings around in {begin,end} pointer pairs like we do
doubles the number of pointers that can be bogotified, so I decided
to preempt mistakes in this area and quench the flexelint warnings
at the same time.

So the assert in pdiff is actually the important part of this.

Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.

More information about the varnish-commit mailing list