This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Query regarding expression evaluation.


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."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]