From: Andrew Cagney <ac131313@ges.redhat.com>
To: Joel Brobecker <brobecker@gnat.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: Should we fix warnings from GCC 2.xx?
Date: Thu, 12 Sep 2002 08:53:00 -0000 [thread overview]
Message-ID: <3D80B892.4050203@ges.redhat.com> (raw)
In-Reply-To: <20020911234319.GN1105@gnat.com>
> 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
next prev parent reply other threads:[~2002-09-12 15:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-09-11 16:43 Joel Brobecker
2002-09-12 8:53 ` Andrew Cagney [this message]
2002-09-12 11:50 ` Joel Brobecker
2002-09-19 4:12 ` Eli Zaretskii
2002-09-19 4:31 ` Andreas Schwab
2002-09-19 4:49 ` Eli Zaretskii
2002-09-19 5:03 ` Andreas Schwab
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=3D80B892.4050203@ges.redhat.com \
--to=ac131313@ges.redhat.com \
--cc=brobecker@gnat.com \
--cc=gdb-patches@sources.redhat.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