[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r38193 - trunk/subversion/libsvn_subr

From: Philip Martin <philip_at_codematters.co.uk>
Date: Thu, 25 Jun 2009 20:18:05 +0100

Stefan Sperling <stsp_at_elego.de> writes:

> He also says you cannot reliably subtract two unsinged numbers
> from one another. But the same holds for signed values. Both can
> wrap around.

In C they are different. Unsigned integer overflow is OK, it has
defined behaviour but signed integer overflow is undefined. Yes, on
most platforms signed integer overflow is perfectly predictable two's
complement, however optimising compilers may assume that it doesn't
happen which can surprise the unwary (that's why gcc has options like
-fstrict-overflow and -fwrapv).

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2365446
Received on 2009-06-25 21:18:26 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.