Re: [PATCH 2/2] os: Work around integer overflow in TimerSet.

2011-03-07 Thread walter harms
Am 06.03.2011 21:34, schrieb Fernando Carrijo: > Cyril Brulebois wrote: > >> If TimerSet gets called with a big timeout, this call can overflow: >> millis += now; >> >> Detect overflow and set millis to the maximal integer when that happens, >> to avoid falling in the “already expired” case.

Re: [PATCH 2/2] os: Work around integer overflow in TimerSet.

2011-03-06 Thread Cyril Brulebois
Hi, Fernando Carrijo (06/03/2011): > I found this, buried in Section 6.2.5 (9) of the C Standard: > > A computation involving unsigned operands can never overflow, > because a result that cannot be represented by the resulting > unsigned integer type is reduced modulo the number that

Re: [PATCH 2/2] os: Work around integer overflow in TimerSet.

2011-03-06 Thread Fernando Carrijo
Cyril Brulebois wrote: > If TimerSet gets called with a big timeout, this call can overflow: > millis += now; > > Detect overflow and set millis to the maximal integer when that happens, > to avoid falling in the “already expired” case. Hi Cyril, I found this, buried in Section 6.2.5 (9) of

[PATCH 2/2] os: Work around integer overflow in TimerSet.

2011-03-06 Thread Cyril Brulebois
If TimerSet gets called with a big timeout, this call can overflow: millis += now; Detect overflow and set millis to the maximal integer when that happens, to avoid falling in the “already expired” case. This is the second (and last) patch to fix the following bugs. Debian Bug 616667