On Thu, 15 Dec 2011, Ondrej Zajicek wrote:
On Thu, Dec 15, 2011 at 11:30:04AM +0100, Martin Mares wrote:
But it seems that your problem is not exactly with signedness, but with overflow (instead of saturation). Overflow works also the same for signed and unsigned ones.
I thought about this some time ago and probably the best solution would be to switch BIRD completely to unsigned behavior (as most route properties with 32bit ranage are defined as unsigned) in some major release.
While I think that switching to unsigned is a good idea, I am not sure that silent overflows make sense. Maybe we should log the overflows or use saturation arithmetics instead.
You are probably right about silent overflows. I would prefer logging them because silent saturation may be unexpected to many users as well.
It is less surprising than the warp-around caused by unsaturated overflows, so it is probably best to do both: saturate and log. -- "One disk to rule them all, One disk to find them. One disk to bring them all and in the darkness grind them. In the Land of Redmond where the shadows lie." -- The Silicon Valley Tarot Henrique Holschuh