Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 2AD5D10FA335 for ; Thu, 10 Nov 2011 15:57:55 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 32598-05 for ; Thu, 10 Nov 2011 19:57:49 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from mailout-de.gmx.net (mailout-de.gmx.net [213.165.64.22]) by mail.postgresql.org (Postfix) with SMTP id E3B3510FA334 for ; Thu, 10 Nov 2011 15:57:48 -0400 (AST) Received: (qmail invoked by alias); 10 Nov 2011 19:57:44 -0000 Received: from a88-115-218-165.elisa-laajakaista.fi (EHLO [10.0.0.102]) [88.115.218.165] by mail.gmx.net (mp058) with SMTP; 10 Nov 2011 20:57:44 +0100 X-Authenticated: #495269 X-Provags-ID: V01U2FsdGVkX1++hPkg9+W+WBlYxLLQz5hW2Dnq4SILTs+ZJccXdX z9IewFfNCO0NyV Message-ID: <1320955063.20692.2.camel@vanquo.pezone.net> Subject: Re: -Wcast-qual cleanup, part 1 From: Peter Eisentraut To: Tom Lane Cc: Robert Haas , pgsql-hackers Date: Thu, 10 Nov 2011 21:57:43 +0200 In-Reply-To: <24642.1320678470@sss.pgh.pa.us> References: <1320642785.25734.13.camel@vanquo.pezone.net> <24642.1320678470@sss.pgh.pa.us> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.0.3-2 Content-Transfer-Encoding: 8bit Mime-Version: 1.0 X-Y-GMX-Trusted: 0 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-3.1 tagged_above=-5 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RP_MATCHES_RCVD=-1.201 X-Spam-Level: X-Archive-Number: 201111/616 X-Sequence-Number: 198104 On mån, 2011-11-07 at 10:07 -0500, Tom Lane wrote: > >> 2. Macros accessing structures should come in two variants: a > "get" > >> version, and a "set"/anything else version, so that the "get" > version > >> can preserve the const qualifier. > > I'm not prepared to buy into that as a general coding rule. > > Maybe it would be better to just add -Wno-cast-qual to CFLAGS. OK, I understand the concerns that have been raised here and in the other thread. I'll work instead on removing "lying" const qualifiers on the upper layers that were the causes of attempting to push the consts down.