summaryrefslogtreecommitdiff
path: root/gdb/doublest.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <dan@debian.org>2002-12-04 05:40:40 +0000
committerDaniel Jacobowitz <dan@debian.org>2002-12-04 05:40:40 +0000
commit7e63a005d2d11025625d255e3e126f1b543d632d (patch)
tree197139e0830721266376e1d59c399a9e051353b2 /gdb/doublest.c
parentdc7584a359228ac027649983951ef74fdf7ef550 (diff)
downloadgdb-7e63a005d2d11025625d255e3e126f1b543d632d.tar.gz
* doublest.c (convert_floatformat_to_doublest): Cast exp_bias to int.
* config/alpha/alpha-linux.mh (MH_CFLAGS): Add -mieee.
Diffstat (limited to 'gdb/doublest.c')
-rw-r--r--gdb/doublest.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/gdb/doublest.c b/gdb/doublest.c
index 6e96d78f0c0..49e36899111 100644
--- a/gdb/doublest.c
+++ b/gdb/doublest.c
@@ -172,12 +172,14 @@ convert_floatformat_to_doublest (const struct floatformat *fmt,
special_exponent = exponent == 0 || exponent == fmt->exp_nan;
-/* Don't bias NaNs. Use minimum exponent for denorms. For simplicity,
- we don't check for zero as the exponent doesn't matter. */
+ /* Don't bias NaNs. Use minimum exponent for denorms. For simplicity,
+ we don't check for zero as the exponent doesn't matter. Note the cast
+ to int; exp_bias is unsigned, so it's important to make sure the
+ operation is done in signed arithmetic. */
if (!special_exponent)
exponent -= fmt->exp_bias;
else if (exponent == 0)
- exponent = 1 - fmt->exp_bias;
+ exponent = 1 - (int) fmt->exp_bias;
/* Build the result algebraically. Might go infinite, underflow, etc;
who cares. */