From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8367 invoked by alias); 13 Nov 2007 00:39:26 -0000 Received: (qmail 8357 invoked by uid 22791); 13 Nov 2007 00:39:25 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 13 Nov 2007 00:39:23 +0000 Received: (qmail 13086 invoked from network); 13 Nov 2007 00:39:21 -0000 Received: from unknown (HELO digraph.polyomino.org.uk) (joseph@127.0.0.2) by mail.codesourcery.com with ESMTPA; 13 Nov 2007 00:39:21 -0000 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.68) (envelope-from ) id 1IrjoG-0007s9-6C; Tue, 13 Nov 2007 00:39:20 +0000 Date: Tue, 13 Nov 2007 00:39:00 -0000 From: "Joseph S. Myers" To: Ulrich Weigand cc: DJ Delorie , gdb-patches@sourceware.org, gcc-patches@gcc.gnu.org Subject: Re: GDB/libiberty support for IBM long double In-Reply-To: <200711090107.lA917ZGs027733@d12av02.megacenter.de.ibm.com> Message-ID: References: <200711090107.lA917ZGs027733@d12av02.megacenter.de.ibm.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-11/txt/msg00234.txt.bz2 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 * 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