[commit] Make exp_bias an int

Andrew Cagney ac131313@redhat.com
Mon Sep 15 21:28:00 GMT 2003


FYI,

I've committed the attached.  It was originally posted:
http://sources.redhat.com/ml/gdb-patches/2002-12/msg00115.html
> Hello,
> 
> The attached addresses a problem with float format's exp_bias (the _difference_ between a true and biased exponent). It was an unsigned, instead of an int. Unfortunatly, due to the nature of C's conversion rules, that unsigned can result in strange behavior. As the comment notes:
> 
> + /* Bias added to a "true" exponent to form the biased exponent. It
> + is intentionally signed as, otherwize, -exp_bias can turn into a
> + very large number (e.g., given the exp_bias of 0x3fff and a 64
> + bit long, the equation (long)(1 - exp_bias) evaluates to
> + 4294950914) instead of -16382). */
> 
> Baring comment, I'll [double] commit this in a few days.
> 
> Andrew
> 
> Wed Dec  4 11:36:04 2002  Andrew Cagney  <cagney@redhat.com>
> 
> 	* floatformat.h (struct floatformat): Change exp_bias to an int.
> 
I guess people have had a bit more than a couple of days :-)

Andrew
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: diffs
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20030915/4cc17d22/attachment.ksh>


More information about the Gdb-patches mailing list