This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: GDB/libiberty support for IBM long double
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Ulrich Weigand <uweigand at de dot ibm dot com>
- Cc: DJ Delorie <dj at redhat dot com>, gdb-patches at sourceware dot org, gcc-patches at gcc dot gnu dot org
- Date: Tue, 13 Nov 2007 00:39:20 +0000 (UTC)
- Subject: Re: GDB/libiberty support for IBM long double
- References: <200711090107.lA917ZGs027733@d12av02.megacenter.de.ibm.com>
On Fri, 9 Nov 2007, Ulrich Weigand wrote:
> Joseph S. Myers wrote:
>
> > (floatformat_ibm_long_double_is_valid,
> > floatformat_ibm_long_double): New.
>
> Looks like something isn't quite right here:
>
> /home/uweigand/fsf/gdb-head/libiberty/floatformat.c: In function 'floatformat_ibm_long_double_is_valid':
> /home/uweigand/fsf/gdb-head/libiberty/floatformat.c:286: warning: comparison between signed and unsigned
> /home/uweigand/fsf/gdb-head/libiberty/floatformat.c:295: warning: comparison between signed and unsigned
> /home/uweigand/fsf/gdb-head/libiberty/floatformat.c:298: warning: unused variable 'mant_bits_left'
> /home/uweigand/fsf/gdb-head/libiberty/floatformat.c:297: warning: unused variable 'mant_off'
> /home/uweigand/fsf/gdb-head/libiberty/floatformat.c:297: warning: unused variable 'mant_bits'
> /home/uweigand/fsf/gdb-head/libiberty/floatformat.c:321: warning: comparison between signed and unsigned
> /home/uweigand/fsf/gdb-head/libiberty/floatformat.c: At top level:
> /home/uweigand/fsf/gdb-head/libiberty/floatformat.c:275: warning: 'floatformat_ibm_long_double_is_valid' defined but not used
>
>
> floatformat_ibm_long_double uses floatformat_always_valid
> instead of floatformat_ibm_long_double_is_valid ...
Thanks, I've applied this patch as obvious after testing.
2007-11-12 Joseph Myers <joseph@codesourcery.com>
* floatformat.c (floatformat_ibm_long_double_is_valid): Fix
compiler warnings.
(floatformat_ibm_long_double): Use
floatformat_ibm_long_double_is_valid.
Index: libiberty/floatformat.c
===================================================================
RCS file: /cvs/src/src/libiberty/floatformat.c,v
retrieving revision 1.22
diff -u -r1.22 floatformat.c
--- libiberty/floatformat.c 8 Nov 2007 00:08:48 -0000 1.22
+++ libiberty/floatformat.c 12 Nov 2007 23:32:04 -0000
@@ -283,7 +283,7 @@
bot_exp = get_field (ufrom + 8, hfmt->byteorder, hfmt->totalsize,
hfmt->exp_start, hfmt->exp_len);
- if (top_exp == hfmt->exp_nan)
+ if ((unsigned long) top_exp == hfmt->exp_nan)
top_nan = mant_bits_set (hfmt, ufrom);
/* A NaN is valid with any low part. */
@@ -292,11 +292,8 @@
/* An infinity, zero or denormal requires low part 0 (positive or
negative). */
- if (top_exp == hfmt->exp_nan || top_exp == 0)
+ if ((unsigned long) top_exp == hfmt->exp_nan || top_exp == 0)
{
- unsigned int mant_bits, mant_off;
- int mant_bits_left;
-
if (bot_exp != 0)
return 0;
@@ -318,7 +315,7 @@
/* The bottom part is 0 or denormal. Determine which, and if
denormal the first two set bits. */
int first_bit = -1, second_bit = -1, cur_bit;
- for (cur_bit = 0; cur_bit < hfmt->man_len; cur_bit++)
+ for (cur_bit = 0; (unsigned int) cur_bit < hfmt->man_len; cur_bit++)
if (get_field (ufrom + 8, hfmt->byteorder, hfmt->totalsize,
hfmt->man_start + cur_bit, 1))
{
@@ -363,7 +360,7 @@
floatformat_big, 128, 0, 1, 11, 1023, 2047, 12, 52,
floatformat_intbit_no,
"floatformat_ibm_long_double",
- floatformat_always_valid,
+ floatformat_ibm_long_double_is_valid,
&floatformat_ieee_double_big
};
--
Joseph S. Myers
joseph@codesourcery.com