From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gateway31.websitewelcome.com (gateway31.websitewelcome.com [192.185.144.28]) by sourceware.org (Postfix) with ESMTPS id 10AC8385BF81 for ; Sun, 17 May 2020 14:05:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 10AC8385BF81 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=tom@tromey.com Received: from cm13.websitewelcome.com (cm13.websitewelcome.com [100.42.49.6]) by gateway31.websitewelcome.com (Postfix) with ESMTP id 8DD2F6E3F for ; Sun, 17 May 2020 09:05:06 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id aJucjjnMzVQh0aJucjnvmJ; Sun, 17 May 2020 09:05:06 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=zCuv5xwNkykWxOf+czV8D4SE5uchYWP/gH6W7E2kTHw=; b=iO/aVVaeXx2VsDTgSVm99YsfkA TACLnZ/BNmnXhakK5A8l4pkMXukj4GXW9tm/4zGX1qXJ+gnE6bPcQhxRIHMLvCK4TvoL3Q28e8c6o AS3BQkFp+/XPZ+rZLl33nrzF/; Received: from 174-16-104-48.hlrn.qwest.net ([174.16.104.48]:40422 helo=bapiya) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1jaJuc-001PBN-9N; Sun, 17 May 2020 08:05:06 -0600 From: Tom Tromey To: Simon Marchi Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [PATCH] Make BLOCK_START and BLOCK_END into rvalues References: <20200516151021.7080-1-tom@tromey.com> X-Attribution: Tom Date: Sun, 17 May 2020 08:05:05 -0600 In-Reply-To: (Simon Marchi's message of "Sat, 16 May 2020 12:15:03 -0400") Message-ID: <87pnb264j2.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 174.16.104.48 X-Source-L: No X-Exim-ID: 1jaJuc-001PBN-9N X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 174-16-104-48.hlrn.qwest.net (bapiya) [174.16.104.48]:40422 X-Source-Auth: tom+tromey.com X-Email-Count: 2 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, JMQ_SPF_NEUTRAL, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_NEUTRAL, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 May 2020 14:05:08 -0000 Simon> This is similar to what I'm doing to struct type, so it would be nice to agree Simon> on the way forward for all these structures, and change them in a consistent Simon> manner. Makes sense. Simon> Since you are changing the places that modify the field values, I'd suggest Simon> adding the setter right away, it's a step in the right direction. Simon> And I'd suggest adding the getter too, changing the BLOCK_START macro to use Simon> it, it shouldn't be much more work. And it will achieve the goal of making Simon> the macro yield an rvalue. I wasn't sure whether setters and getters would provide any real value. Aside from some maybe-future idea of changing the getter, in other situations they are just wrappers for the field. For struct type, maybe it makes more sense, because one (very-) long-term idea there would be to split up struct main_type into an inheritance hierarchy, so that each type can be more obviously type-safe, and also carry just the data it needs. I don't mind making the change -- it's easy enough to do. Tom