From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1578 invoked by alias); 21 Sep 2017 16:53:02 -0000 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 Received: (qmail 998 invoked by uid 89); 21 Sep 2017 16:53:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-6.6 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mga06.intel.com Received: from mga06.intel.com (HELO mga06.intel.com) (134.134.136.31) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 21 Sep 2017 16:53:00 +0000 Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga104.jf.intel.com with ESMTP; 21 Sep 2017 09:52:57 -0700 X-ExtLoop1: 1 Received: from irsmsx151.ger.corp.intel.com ([163.33.192.59]) by fmsmga006.fm.intel.com with ESMTP; 21 Sep 2017 09:52:49 -0700 Received: from irsmsx104.ger.corp.intel.com ([169.254.5.248]) by IRSMSX151.ger.corp.intel.com ([169.254.4.108]) with mapi id 14.03.0319.002; Thu, 21 Sep 2017 17:52:49 +0100 From: "Metzger, Markus T" To: Pedro Alves , Tom Tromey , "gdb-patches@sourceware.org" Subject: RE: [RFA 49/67] Constify some commands in btrace.c Date: Thu, 21 Sep 2017 16:53:00 -0000 Message-ID: References: <20170921051023.19023-1-tom@tromey.com> <20170921051023.19023-50-tom@tromey.com> <74f1184e-0d97-1082-4a51-3ae99c55717a@redhat.com> <83de5929-b2f2-fbd5-effd-740c21cd2a98@redhat.com> In-Reply-To: <83de5929-b2f2-fbd5-effd-740c21cd2a98@redhat.com> dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2017-09/txt/msg00652.txt.bz2 > -----Original Message----- > From: Pedro Alves [mailto:palves@redhat.com] > Sent: Thursday, September 21, 2017 3:47 PM > To: Metzger, Markus T ; Tom Tromey > ; gdb-patches@sourceware.org > Subject: Re: [RFA 49/67] Constify some commands in btrace.c Hello Pedro, > > My reason is simply to not mix different styles. > > >=20 > Alright, that's certainly a valid reason. >=20 > My view is that declarations in the middle of blocks are > desirable, and enforcing top-of-block-only consistency too > strongly prevents incremental modernization a bit, since it > puts the bar higher (because either everything is converted, > or else nothing is). So personally I'm fine with mixed style, > and I try to push for declare-at-initialization when it > makes sense. I find top declarations more readable but I see the need for C++ objects. And I value consistency. So let's go with mixed style everywhere. =20 > Ack. To me, if we need a simpler rationale, it could go > like this: middle-of-block declaration+initialization makes > sense with non-trivial types. And if we accept middle-of-block > declarations with non-trivial types, then there's no good > rationale for not allowing them with scalar types too. Agreed. > > So please ignore my comments on declaration placement. >=20 > On the contrary, it's not my intention to make your comment > be ignored, rather that we all discuss this and end up on > the same page. So thanks for the discussion, and really sorry > if I sounded too nit picky. Tom still needs to ignore my previous comment on declaration placement;-) In this and in other patches of this series. >=20 > ----- >=20 > BTW, looking at the get_context_size function in question, it > seems like the 'number' variable is not used, meaning we could > apply something like this: >=20 > static int > get_context_size (char **arg) > { > - char *pos; > - int number; > - > - pos =3D skip_spaces (*arg); > + char *pos =3D skip_spaces (*arg); >=20 > if (!isdigit (*pos)) > error (_("Expected positive number, got: %s."), pos); >=20 > return strtol (pos, arg, 10); > } Tom's patch changed the parameter to const char so we still need the char *end detour. You're right, though, that NUMBER is not used and that the declaration can be removed. Thanks, Markus. Intel Deutschland GmbH Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany Tel: +49 89 99 8853-0, www.intel.de Managing Directors: Christin Eisenschmid, Christian Lamprechter Chairperson of the Supervisory Board: Nicole Lau Registered Office: Munich Commercial Register: Amtsgericht Muenchen HRB 186928