http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46899
--- Comment #11 from Eskil Steenberg 2010-12-13
14:09:46 UTC ---
Hi
> The execution of an undefined operation produces an undefined value, and
> any further operation becomes undefined.
My argument is that, at compile time this isn't known. Jus
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46899
--- Comment #10 from Andreas Schwab 2010-12-13 00:21:09
UTC ---
The execution of an undefined operation produces an undefined value, and any
further operation becomes undefined.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46899
--- Comment #9 from Eskil Steenberg 2010-12-12
22:23:36 UTC ---
Hi
> No, it is possible because the value is undefined so both the if being
> false and the printout happening can happen.
But undefined still means that the variable c has a value
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46899
--- Comment #8 from Andrew Pinski 2010-12-12
21:52:40 UTC ---
>This output should not be possible
No, it is possible because the value is undefined so both the if being false
and the printout happening can happen.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46899
--- Comment #7 from Eskil Steenberg 2010-12-12
21:46:18 UTC ---
Hi
> No, it is undefined at runtime. This again is not an undefined behavior
> at
> compile time but rather at runtime. What that means is the behavior
> cannot be
> diagnosed (at
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46899
--- Comment #6 from Andrew Pinski 2010-12-12
21:02:55 UTC ---
>it is undefined at compile time?
No, it is undefined at runtime. This again is not an undefined behavior at
compile time but rather at runtime. What that means is the behavior cann
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46899
--- Comment #5 from Eskil Steenberg 2010-12-12
12:30:15 UTC ---
Hi
>>void my_func(unsigned short a, unsigned short c)
>>{
>>unsigned int b;
>>
>>b = a * c;
>
> There is no overflow here since this unsigned integers wrap and don't
> overf
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46899
Andrew Pinski changed:
What|Removed |Added
Status|UNCONFIRMED |RESOLVED
Resolution|
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46899
--- Comment #3 from Eskil Steenberg 2010-12-12
09:09:54 UTC ---
Hi
> (In reply to comment #1)
>> There is no integer overflow in the code provided at all.
Sorry it underflows. How about this:
void my_func(unsigned short a, unsigned short c)
{
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46899
--- Comment #2 from Andrew Pinski 2010-12-12
01:55:56 UTC ---
(In reply to comment #1)
> There is no integer overflow in the code provided at all.
Even if there was, the standard says the behavior is undefined which means
anything can happen.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46899
--- Comment #1 from Andrew Pinski 2010-12-12
01:54:16 UTC ---
There is no integer overflow in the code provided at all.
11 matches
Mail list logo