From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6496 invoked by alias); 3 Mar 2011 17:11:23 -0000 Received: (qmail 6480 invoked by uid 22791); 3 Mar 2011 17:11:21 -0000 X-SWARE-Spam-Status: No, hits=-5.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-outbound-1.vmware.com (HELO smtp-outbound-1.vmware.com) (65.115.85.69) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 03 Mar 2011 17:11:17 +0000 Received: from mailhost4.vmware.com (mailhost4.vmware.com [10.16.67.124]) by smtp-outbound-1.vmware.com (Postfix) with ESMTP id 99DC73C00B; Thu, 3 Mar 2011 09:11:13 -0800 (PST) Received: from msnyder-server.eng.vmware.com (promd-2s-dhcp138.eng.vmware.com [10.20.124.138]) by mailhost4.vmware.com (Postfix) with ESMTP id 8FF36C9E9A; Thu, 3 Mar 2011 09:11:13 -0800 (PST) Message-ID: <4D6FCBB1.9040507@vmware.com> Date: Thu, 03 Mar 2011 17:11:00 -0000 From: Michael Snyder User-Agent: Thunderbird 2.0.0.24 (X11/20101201) MIME-Version: 1.0 To: Joel Brobecker CC: "gdb-patches@sourceware.org" Subject: Re: [RFA] breakpoint.c, create_breakpoint, document that the case statement falls through. References: <4D6EE3D9.2040108@vmware.com> <20110303042652.GU30306@adacore.com> In-Reply-To: <20110303042652.GU30306@adacore.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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/msg00184.txt.bz2 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). > No, honest, it *does* fall through! I had to use a printf statement to convince myself. ;-) When the user answers "yes" to the query, it falls through.