Re: [PATCH jiffies] Avoid undefined behavior from signed overflow

2013-08-04 Thread Paul E. McKenney
On Sun, Aug 04, 2013 at 01:23:13PM -0700, Linus Torvalds wrote: > On Sun, Aug 4, 2013 at 1:20 PM, Paul E. McKenney > wrote: > > > > I have it queued up for 3.12, as you say, due to "-fno-strict-overflow". > > But if you would rather have it sooner, please let me know and I will send > > a pull req

Re: [PATCH jiffies] Avoid undefined behavior from signed overflow

2013-08-04 Thread Linus Torvalds
On Sun, Aug 4, 2013 at 1:20 PM, Paul E. McKenney wrote: > > I have it queued up for 3.12, as you say, due to "-fno-strict-overflow". > But if you would rather have it sooner, please let me know and I will send > a pull request. No, that's fine. As long as it's somewhere. 3.12 is better, rc4 is al

Re: [PATCH jiffies] Avoid undefined behavior from signed overflow

2013-08-04 Thread Paul E. McKenney
On Sun, Aug 04, 2013 at 12:16:02PM -0700, Linus Torvalds wrote: > On Mon, Jul 29, 2013 at 7:28 AM, Paul E. McKenney > wrote: > >> > >> Ahh, there's an error in the commit message (it says signed to unsigned). > > > > Good catch, fixed! > > .. so I ended up waiting for that fixed version due to th

Re: [PATCH jiffies] Avoid undefined behavior from signed overflow

2013-08-04 Thread Linus Torvalds
On Mon, Jul 29, 2013 at 7:28 AM, Paul E. McKenney wrote: >> >> Ahh, there's an error in the commit message (it says signed to unsigned). > > Good catch, fixed! .. so I ended up waiting for that fixed version due to this email, but it never came. Should I just apply the original and re-fix it myse

Re: [PATCH jiffies] Avoid undefined behavior from signed overflow

2013-07-29 Thread Paul E. McKenney
On Tue, Jul 30, 2013 at 12:01:03AM +1000, Kevin Easton wrote: > Quoting "Paul E. McKenney" : > > >On Mon, Jul 29, 2013 at 03:30:35PM +1000, c...@guarana.org wrote: > >>Quoting "Paul E. McKenney" : > >> > ... > >>> > >>>Note that the C standard considers the cast from signed to > >>>unsigned to be

Re: [PATCH jiffies] Avoid undefined behavior from signed overflow

2013-07-29 Thread Kevin Easton
Quoting "Paul E. McKenney" : On Mon, Jul 29, 2013 at 03:30:35PM +1000, c...@guarana.org wrote: Quoting "Paul E. McKenney" : ... > >Note that the C standard considers the cast from signed to >unsigned to be implementation-defined, see 6.3.1.3p3. ... Don't worry, the case from signed to uns

Re: [PATCH jiffies] Avoid undefined behavior from signed overflow

2013-07-29 Thread Paul E. McKenney
On Mon, Jul 29, 2013 at 03:30:35PM +1000, c...@guarana.org wrote: > Quoting "Paul E. McKenney" : > > >According to the C standard 3.4.3p3, overflow of a signed integer results > >in undefined behavior. This commit therefore changes the definitions > >of time_after() and time_after_eq() to avoid t

Re: [PATCH jiffies] Avoid undefined behavior from signed overflow

2013-07-28 Thread caf
Quoting "Paul E. McKenney" : According to the C standard 3.4.3p3, overflow of a signed integer results in undefined behavior. This commit therefore changes the definitions of time_after() and time_after_eq() to avoid this undefined behavior. The trick is that the subtraction is done using unsig

Re: [PATCH jiffies] Avoid undefined behavior from signed overflow

2013-07-28 Thread Paul E. McKenney
On Sun, Jul 28, 2013 at 11:46:59AM -0700, Eric Dumazet wrote: > On Sat, 2013-07-27 at 15:58 -0700, Paul E. McKenney wrote: > > According to the C standard 3.4.3p3, overflow of a signed integer results > > in undefined behavior. This commit therefore changes the definitions > > of time_after() and

Re: [PATCH jiffies] Avoid undefined behavior from signed overflow

2013-07-28 Thread Eric Dumazet
On Sat, 2013-07-27 at 15:58 -0700, Paul E. McKenney wrote: > According to the C standard 3.4.3p3, overflow of a signed integer results > in undefined behavior. This commit therefore changes the definitions > of time_after() and time_after_eq() to avoid this undefined behavior. > The trick is that

[PATCH jiffies] Avoid undefined behavior from signed overflow

2013-07-27 Thread Paul E. McKenney
According to the C standard 3.4.3p3, overflow of a signed integer results in undefined behavior. This commit therefore changes the definitions of time_after() and time_after_eq() to avoid this undefined behavior. The trick is that the subtraction is done using unsigned arithmetic, which according