From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17100 invoked by alias); 12 Sep 2002 15:53:59 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 17089 invoked from network); 12 Sep 2002 15:53:57 -0000 Received: from unknown (HELO localhost.redhat.com) (216.138.202.10) by sources.redhat.com with SMTP; 12 Sep 2002 15:53:57 -0000 Received: from ges.redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id DC3E13C44; Thu, 12 Sep 2002 11:53:54 -0400 (EDT) Message-ID: <3D80B892.4050203@ges.redhat.com> Date: Thu, 12 Sep 2002 08:53:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.0) Gecko/20020824 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Joel Brobecker Cc: gdb-patches@sources.redhat.com Subject: Re: Should we fix warnings from GCC 2.xx? References: <20020911234319.GN1105@gnat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2002-09/txt/msg00201.txt.bz2 > While building GDB from CVS on my Linux machines, I saw a few warnings > like this one: > > >> tracepoint.c: In function `trace_find_tracepoint_command': >> tracepoint.c:2077: warning: suggest explicit braces to avoid ambiguous `else' > > > This warning appears with a GCC 2.8.1-based compiler, but does not > with GCC 3.0.4. Hence my question, do we want to fix these warnings > anyway? Regardless, I don't see how it can hurt. Removes the dangling `else' problem. Andrew > I guess for a lot of warnings, the fix are quite straghtforward, like > this: > << > Index: tracepoint.c > =================================================================== > RCS file: /cvs/src/src/gdb/tracepoint.c,v > retrieving revision 1.40 > diff -c -3 -p -r1.40 tracepoint.c > *** tracepoint.c 24 Jul 2002 17:58:46 -0000 1.40 > --- tracepoint.c 11 Sep 2002 23:33:52 -0000 > *************** trace_find_tracepoint_command (char *arg > *** 2071,2080 **** > if (target_is_remote ()) > { > if (args == 0 || *args == 0) > ! if (tracepoint_number == -1) > ! error ("No current tracepoint -- please supply an argument."); > ! else > ! tdp = tracepoint_number; /* default is current TDP */ > else > tdp = parse_and_eval_long (args); > > --- 2071,2082 ---- > if (target_is_remote ()) > { > if (args == 0 || *args == 0) > ! { > ! if (tracepoint_number == -1) > ! error ("No current tracepoint -- please supply an argument."); > ! else > ! tdp = tracepoint_number; /* default is current TDP */ > ! } > else > tdp = parse_and_eval_long (args); > > >>> > > > -- Joel