"Dr. Werner Fink" <wer...@suse.de> writes:

> On x86_64 the gdb shows:
>
>  Program received signal SIGFPE, Arithmetic exception.
>  0x0000000000462cd5 in exp2 () at expr.c:761
>  761             val1 /= val2;
>  (gdb) print val1
>  $1 = -9223372036854775808
>  (gdb) print val2
>  $2 = -1
>
> which is strange.

Not at all.  Overflow invokes undefined behaviour.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


Reply via email to