From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14800 invoked by alias); 28 Dec 2006 22:56:22 -0000 Received: (qmail 14792 invoked by uid 22791); 28 Dec 2006 22:56:21 -0000 X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO brahms.sibelius.xs4all.nl) (82.92.89.47) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 28 Dec 2006 22:56:17 +0000 Received: from brahms.sibelius.xs4all.nl (kettenis@localhost.sibelius.xs4all.nl [127.0.0.1]) by brahms.sibelius.xs4all.nl (8.13.8/8.13.8) with ESMTP id kBSMu61f022473; Thu, 28 Dec 2006 23:56:06 +0100 (CET) Received: (from kettenis@localhost) by brahms.sibelius.xs4all.nl (8.13.8/8.13.8/Submit) id kBSMu65R022410; Thu, 28 Dec 2006 23:56:06 +0100 (CET) Date: Thu, 28 Dec 2006 22:56:00 -0000 Message-Id: <200612282256.kBSMu65R022410@brahms.sibelius.xs4all.nl> From: Mark Kettenis To: drow@false.org CC: gdb-patches@sourceware.org In-reply-to: <20061228195828.GA18628@nevyn.them.org> (message from Daniel Jacobowitz on Thu, 28 Dec 2006 14:58:28 -0500) Subject: Re: RFC: Warning fixes References: <20061228195828.GA18628@nevyn.them.org> 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: 2006-12/txt/msg00335.txt.bz2 > Date: Thu, 28 Dec 2006 14:58:28 -0500 > From: Daniel Jacobowitz > > Any comments on these, or shall I commit them? Regardless of the configure > patch, we might as well fix the bugs. Some of these are really scary. Can you check for regressions on i386 Linux? The only thing that bothers me is this one: > Index: signals/signals.c > =================================================================== > RCS file: /cvs/src/src/gdb/signals/signals.c,v > retrieving revision 1.11 > diff -u -p -r1.11 signals.c > --- signals/signals.c 28 Nov 2006 19:45:07 -0000 1.11 > +++ signals/signals.c 28 Dec 2006 19:42:04 -0000 > @@ -219,7 +219,7 @@ static struct { > char * > target_signal_to_string (enum target_signal sig) > { > - if ((sig >= TARGET_SIGNAL_FIRST) && (sig <= TARGET_SIGNAL_LAST)) > + if (sig <= TARGET_SIGNAL_LAST) > return signals[sig].string; > else > return signals[TARGET_SIGNAL_UNKNOWN].string; > @@ -229,8 +229,7 @@ target_signal_to_string (enum target_sig > char * > target_signal_to_name (enum target_signal sig) > { > - if ((sig >= TARGET_SIGNAL_FIRST) && (sig <= TARGET_SIGNAL_LAST) > - && signals[sig].name != NULL) > + if (sig <= TARGET_SIGNAL_LAST && signals[sig].name != NULL) > return signals[sig].name; > else > /* I think the code which prints this will always print it along ISO C clearly states that enumeration constants have type 'int', so sig could be negative, and we defenitely want to catch that case. If GCC thinks it knows that (sig >= TARGET_SIGNAL_FIRST), I think it is being too smart for its own good. Mark