From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 97242 invoked by alias); 28 Feb 2019 07:41:16 -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 97225 invoked by uid 89); 28 Feb 2019 07:41:15 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_PASS autolearn=ham version=3.3.2 spammy=directors, Commercial, Directors, Lau X-HELO: mga01.intel.com Received: from mga01.intel.com (HELO mga01.intel.com) (192.55.52.88) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 28 Feb 2019 07:41:14 +0000 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Feb 2019 23:41:12 -0800 Received: from irsmsx107.ger.corp.intel.com ([163.33.3.99]) by orsmga002.jf.intel.com with ESMTP; 27 Feb 2019 23:41:12 -0800 Received: from irsmsx104.ger.corp.intel.com ([169.254.5.56]) by IRSMSX107.ger.corp.intel.com ([169.254.10.229]) with mapi id 14.03.0415.000; Thu, 28 Feb 2019 07:41:11 +0000 From: "Metzger, Markus T" To: Tom Tromey , "gdb-patches@sourceware.org" Subject: RE: [PATCH 4/7] Add ATTRIBUTE_UNUSED_RESULT to scoped_mmap Date: Thu, 28 Feb 2019 07:41:00 -0000 Message-ID: References: <20190227221814.17661-1-tromey@adacore.com> <20190227221814.17661-5-tromey@adacore.com> In-Reply-To: <20190227221814.17661-5-tromey@adacore.com> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2019-02/txt/msg00561.txt.bz2 > This applies ATTRIBUTE_UNUSED_RESULT to scoped_mmap::release and fixes a > couple of spots to comply. >=20 > 2019-02-27 Tom Tromey >=20 > * nat/linux-btrace.c (linux_enable_bts, linux_enable_pt): Update. > * common/scoped_mmap.h (class scoped_mmap) : Add > ATTRIBUTE_UNUSED_RESULT. I don't really see the need for such a change but the patch LGTM. Can we a= void the warning by casting the result to void in case it becomes too awkward ot= herwise? E.g. (void) data.release (); In this case, for example, ... > - pt->header =3D header; > + pt->header =3D (struct perf_event_mmap_page *) data.release (); > + gdb_assert (pt->header =3D=3D header); ...we're storing the base pointer. But we could also store &header->, which would make it pretty awkward to use the result of release (). 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, , Gary Kershaw Chairperson of the Supervisory Board: Nicole Lau Registered Office: Munich Commercial Register: Amtsgericht Muenchen HRB 186928