Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Michael Snyder <msnyder@vmware.com>
To: Pedro Alves <pedro@codesourcery.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [commit] cli/cli-script.c, script_from_file, add a break stmt for lint
Date: Thu, 03 Mar 2011 17:33:00 -0000	[thread overview]
Message-ID: <4D6FD0D1.6000506@vmware.com> (raw)
In-Reply-To: <201103030948.22048.pedro@codesourcery.com>

Pedro Alves wrote:
> On Thursday 03 March 2011 00:15:55, Michael Snyder wrote:
>> checked in.
> 
>>   2011-03-02  Michael Snyder  <msnyder@vmware.com>
>>
>>         * cli/cli-script.c (script_from_file): Add break for lint.
> 
>>         throw_error (e.error,
>>                      _("%s:%d: Error in sourced command file:\n%s"),
>>                      source_file_name, source_line_number, e.message);
>> +       break;  /* lint */
> 
> Please don't.  Teach lint about the no-return property of throw_error instead.
> 
>>        default:
>>         internal_error (__FILE__, __LINE__, _("bad reason"));
>>        }
> 

I used "lint" loosely, to mean any checker including a human.
It makes things clearer.  There is plenty of precident in gdb:

language.c:  return (struct type *) 0;  /* For lint */
mt-tdep.c:          default:            /* lint */
valarith.c:  return 0;                  /* For lint -- never reached */
valops.c:  return 0;                    /* For lint -- never reached.  */
value.c:  return 0;                     /* Placate lint.  */


  reply	other threads:[~2011-03-03 17:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-03  0:16 Michael Snyder
2011-03-03  9:48 ` Pedro Alves
2011-03-03 17:33   ` Michael Snyder [this message]
2011-03-03 17:48     ` Tom Tromey
2011-03-03 17:59     ` Pedro Alves
2011-03-04 18:21       ` Michael Snyder
2011-03-04 18:24         ` Tom Tromey

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=4D6FD0D1.6000506@vmware.com \
    --to=msnyder@vmware.com \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@codesourcery.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