Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bn6eB-0000mo-Ej for pgsql-hackers@arkaria.postgresql.org; Thu, 22 Sep 2016 16:14:51 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bn6eA-0005WJ-Iq for pgsql-hackers@arkaria.postgresql.org; Thu, 22 Sep 2016 16:14:50 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bn6e7-0005Ux-Jo for pgsql-hackers@postgresql.org; Thu, 22 Sep 2016 16:14:47 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bn6e5-0005Df-CE for pgsql-hackers@postgresql.org; Thu, 22 Sep 2016 16:14:46 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id u8MGEh3n026711; Thu, 22 Sep 2016 12:14:43 -0400 From: Tom Lane To: Mark Dilger cc: PostgreSQL-development Subject: Re: gratuitous casting away const In-reply-to: <96DBB26C-34FF-4090-98A8-6DDA5136AC73@gmail.com> References: <20919.1474402019@sss.pgh.pa.us> <96DBB26C-34FF-4090-98A8-6DDA5136AC73@gmail.com> Comments: In-reply-to Mark Dilger message dated "Tue, 20 Sep 2016 14:33:17 -0700" Date: Thu, 22 Sep 2016 12:14:43 -0400 Message-ID: <26710.1474560883@sss.pgh.pa.us> X-Pg-Spam-Score: -5.0 (-----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Mark Dilger writes: >> On Sep 20, 2016, at 1:06 PM, Tom Lane wrote: >> ... that seems to be discarding type information in order to add >> "const"; does not seem like a net benefit from here. > The following seems somewhere in between, with ItemPointer > changing to const ItemPointerData *. I expect you would not care > for this change, but thought I'd check to see where you draw the line: I'd call this kind of a wash, I guess. I'd be more excited about it if the change allowed removal of an actual cast-away-of-constness somewhere. I suppose it's a bit of a chicken and egg situation, in that the lack of const markings on leaf subroutines discourages use of "const" in callers, and you have to start somewhere if you want to make it better. But I don't really want to just plaster "const" onto individual functions without some larger vision of where we're going and which code is going to benefit. Otherwise it seems like mostly just code churn. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers