From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by fantadrom.bsd.lv (OpenSMTPD) with ESMTP id 0f779983 for ; Fri, 15 Jul 2016 16:31:06 -0500 (EST) Received: from britannica.bec.de (p20030057E216B204C83B2DA945FE574C.dip0.t-ipconnect.de [IPv6:2003:57:e216:b204:c83b:2da9:45fe:574c]) (Authenticated sender: joerg@bec.de) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 451C5A80C4 for ; Fri, 15 Jul 2016 23:31:05 +0200 (CEST) Date: Fri, 15 Jul 2016 23:31:03 +0200 From: Joerg Sonnenberger To: source@mdocml.bsd.lv Subject: Re: mdocml: To remove the const qualifier from a pointer to an object - Message-ID: <20160715213103.GA7335@britannica.bec.de> Mail-Followup-To: source@mdocml.bsd.lv References: <15489725859697430873.enqueue@fantadrom.bsd.lv> X-Mailinglist: mdocml-source Reply-To: source@mdocml.bsd.lv MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <15489725859697430873.enqueue@fantadrom.bsd.lv> User-Agent: Mutt/1.6.1 (2016-04-27) On Fri, Jul 15, 2016 at 02:33:31PM -0500, schwarze@mdocml.bsd.lv wrote: > To remove the const qualifier from a pointer to an object - either > because we know it is actually mutable or because we are passing > it to a function that doesn't accept a const object but won't > actually attempt to modify it - simply casting from (const type *) > to (type *) is legal C and clearly expresses the intent. > So get rid of the obfuscating UNCONST macro. > Basic idea discussed with guenther@. This is completely wrong and a clear regression. The macro exists for two reasons: (1) It makes auditing easier by giving something simple to look for. (2) The macro actually stopped -Wcast warnings. The replacement does not. Joerg -- To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv