Re: round_up integer underflow

2015-07-23 Thread Alexey Dobriyan
On Thu, Jul 23, 2015 at 11:10:30AM -0700, Jörn Engel wrote: > On Thu, Jul 23, 2015 at 11:02:55AM -0700, Jörn Engel wrote: > > Spencer spotted something nasty in the round_up macro. We were > > wondering why round_up() worked differently from ALIGN. The only real > > difference between the two

Re: round_up integer underflow

2015-07-23 Thread Jörn Engel
On Thu, Jul 23, 2015 at 11:02:55AM -0700, Jörn Engel wrote: > Spencer spotted something nasty in the round_up macro. We were > wondering why round_up() worked differently from ALIGN. The only real > difference between the two patterns is overflow behaviour. And both > version are buggy when

round_up integer underflow

2015-07-23 Thread Jörn Engel
Spencer spotted something nasty in the round_up macro. We were wondering why round_up() worked differently from ALIGN. The only real difference between the two patterns is overflow behaviour. And both version are buggy when used for signed integer types, round_up will underflow on INT_MIN,

Re: round_up integer underflow

2015-07-23 Thread Alexey Dobriyan
On Thu, Jul 23, 2015 at 11:10:30AM -0700, Jörn Engel wrote: On Thu, Jul 23, 2015 at 11:02:55AM -0700, Jörn Engel wrote: Spencer spotted something nasty in the round_up macro. We were wondering why round_up() worked differently from ALIGN. The only real difference between the two patterns

round_up integer underflow

2015-07-23 Thread Jörn Engel
Spencer spotted something nasty in the round_up macro. We were wondering why round_up() worked differently from ALIGN. The only real difference between the two patterns is overflow behaviour. And both version are buggy when used for signed integer types, round_up will underflow on INT_MIN,

Re: round_up integer underflow

2015-07-23 Thread Jörn Engel
On Thu, Jul 23, 2015 at 11:02:55AM -0700, Jörn Engel wrote: Spencer spotted something nasty in the round_up macro. We were wondering why round_up() worked differently from ALIGN. The only real difference between the two patterns is overflow behaviour. And both version are buggy when used