http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48580
--- Comment #7 from joseph at codesourcery dot com 2011-04-12 21:16:41 UTC ---
On Tue, 12 Apr 2011, zackw at panix dot com wrote:
> Addendum: what would *you* describe as the correct C idiom for
> ensuring that the product of two signed integers
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48580
--- Comment #6 from joseph at codesourcery dot com 2011-04-12 21:09:53 UTC ---
On Tue, 12 Apr 2011, zackw at panix dot com wrote:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48580
>
> --- Comment #4 from Zack Weinberg 2011-04-12
> 21:03:01 U
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48580
--- Comment #5 from Zack Weinberg 2011-04-12 21:04:34
UTC ---
Addendum: what would *you* describe as the correct C idiom for
ensuring that the product of two signed integers was positive and did
not overflow the range of a same-sized signed integ
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48580
--- Comment #4 from Zack Weinberg 2011-04-12 21:03:01
UTC ---
On Tue, Apr 12, 2011 at 1:52 PM, joseph at codesourcery dot com
wrote:
>> In the code that this is cut down from, both arguments are known to be
>> strictly
>> positive, but neither
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48580
--- Comment #3 from joseph at codesourcery dot com 2011-04-12 20:52:48 UTC ---
On Tue, 12 Apr 2011, zackw at panix dot com wrote:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48580
>
> --- Comment #2 from Zack Weinberg 2011-04-12
> 20:40:41 U
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48580
--- Comment #2 from Zack Weinberg 2011-04-12 20:40:41
UTC ---
(In reply to comment #1)
>
> Two signed integers given that they are known to be positive, anyway.
> This may return unexpected results if either or both arguments are
> negative o
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48580
--- Comment #1 from joseph at codesourcery dot com 2011-04-12 20:18:13 UTC ---
On Tue, 12 Apr 2011, zackw at panix dot com wrote:
> To the best of my knowledge, this is the only safe way (without -fwrapv) to
> check whether the product of two sig