bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bash-bug] Can arithmetic evaluation trap more than just division by


From: Roman Rakus
Subject: Re: [bash-bug] Can arithmetic evaluation trap more than just division by zero?
Date: Tue, 06 Apr 2010 16:09:39 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100330 Fedora/3.0.4-1.fc11 Lightning/1.0b2pre Thunderbird/3.0.4

On 04/06/2010 03:59 PM, Andreas Schwab wrote:
"Dr. Werner Fink"<address@hidden>  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.

But why there is no overflow on 32bit system?
RR




reply via email to

[Prev in Thread] Current Thread [Next in Thread]