From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28902 invoked by alias); 3 Mar 2011 09:55:43 -0000 Received: (qmail 28894 invoked by uid 22791); 3 Mar 2011 09:55:42 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 03 Mar 2011 09:55:38 +0000 Received: (qmail 26617 invoked from network); 3 Mar 2011 09:55:37 -0000 Received: from unknown (HELO scottsdale.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 3 Mar 2011 09:55:37 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: [RFA] breakpoint.c, create_breakpoint, document that the case statement falls through. Date: Thu, 03 Mar 2011 09:55:00 -0000 User-Agent: KMail/1.13.5 (Linux/2.6.35-27-generic; KDE/4.6.0; x86_64; ; ) Cc: Joel Brobecker , Michael Snyder References: <4D6EE3D9.2040108@vmware.com> <20110303042652.GU30306@adacore.com> In-Reply-To: <20110303042652.GU30306@adacore.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201103030955.43387.pedro@codesourcery.com> X-IsSubscribed: yes 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: 2011-03/txt/msg00162.txt.bz2 On Thursday 03 March 2011 04:26:52, Joel Brobecker wrote: > > 2011-03-02 Michael Snyder > > > > * breakpoint.c (create_breakpoint): Document that case falls through. > > > > Index: breakpoint.c > > =================================================================== > > RCS file: /cvs/src/src/gdb/breakpoint.c,v > > retrieving revision 1.546 > > diff -u -p -u -p -r1.546 breakpoint.c > > --- breakpoint.c 1 Mar 2011 02:16:56 -0000 1.546 > > +++ breakpoint.c 3 Mar 2011 00:38:01 -0000 > > @@ -7843,6 +7843,7 @@ create_breakpoint (struct gdbarch *gdbar > > default: > > throw_exception (e); > > } > > + /* FALLTHROUGH */ > > default: > > if (!sals.nelts) > > return 0; > > Just some thoughts: > > It's actually never going to fall through, is it? Can we use "break;" > instead, even if we know it's never going to be reached? I think > it would make it clearer by not suggesting something that isn't > supposed to happen (the fall through). The root problem seems to be that lint hasn't been tought that throw_exception doesn't return, so it thinks we do fall-through. There are mechanisms to teach lint about the no-return property of functions. -- Pedro Alves