Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Joseph S. Myers" <joseph@codesourcery.com>
To: Ulrich Weigand <uweigand@de.ibm.com>
Cc: DJ Delorie <dj@redhat.com>,
	gdb-patches@sourceware.org,      gcc-patches@gcc.gnu.org
Subject: Re: GDB/libiberty support for IBM long double
Date: Tue, 13 Nov 2007 00:39:00 -0000	[thread overview]
Message-ID: <Pine.LNX.4.64.0711130038330.29493@digraph.polyomino.org.uk> (raw)
In-Reply-To: <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
 };
 \f

-- 
Joseph S. Myers
joseph@codesourcery.com


  reply	other threads:[~2007-11-13  0:39 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-26  0:25 Joseph S. Myers
2007-10-26  0:37 ` DJ Delorie
2007-10-29  1:31   ` Joseph S. Myers
2007-11-05 22:33     ` Ping " Joseph S. Myers
2007-11-07 22:43     ` Daniel Jacobowitz
2007-11-07 23:26       ` DJ Delorie
2007-11-09  1:07     ` Ulrich Weigand
2007-11-13  0:39       ` Joseph S. Myers [this message]
2007-11-13 13:56         ` Ulrich Weigand
2007-11-13 14:37           ` Joseph S. Myers
2007-11-13 15:15             ` DJ Delorie
2007-11-13 17:58               ` Ulrich Weigand
2007-12-28  1:20         ` Luis Machado
2007-12-28 12:29           ` Andreas Schwab
2007-12-28 21:40             ` Luis Machado
2007-12-30 11:25               ` Daniel Jacobowitz
2008-01-02 16:17                 ` Luis Machado
2008-01-02 17:01                   ` Daniel Jacobowitz
2008-01-02 18:12                     ` Luis Machado
2008-01-02 18:32                       ` Daniel Jacobowitz
2008-01-03 11:47                         ` Luis Machado
2007-10-26  8:05 ` Mark Kettenis
2007-10-26 15:01   ` Joseph S. Myers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.64.0711130038330.29493@digraph.polyomino.org.uk \
    --to=joseph@codesourcery.com \
    --cc=dj@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=uweigand@de.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox