This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Query regarding expression evaluation.
- From: Andreas Schwab <schwab at suse dot de>
- To: ramana dot radhakrishnan at codito dot com
- Cc: gdb at sources dot redhat dot com
- Date: Wed, 10 Aug 2005 17:44:33 +0200
- Subject: Re: Query regarding expression evaluation.
- References: <1123684979.29036.21.camel@localhost.localdomain>
Ramana Radhakrishnan <ramana.radhakrishnan@codito.com> writes:
> Look at PR1978 . The discrepancy is because in valarith.c , GDB takes
> the operation to be unsigned depending only on the operand types. In the
> case described in the PR this seems alright with respect to the C
> standard since the result is implementation dependent.
For the shift operator the result is completely independent of the type of
the right operand. So the way gdb evaluates the expression is clearly
wrong.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."