source@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Joerg Sonnenberger <joerg@mdocml.bsd.lv>
To: source@mdocml.bsd.lv
Subject: Re: mdocml: To remove the const qualifier from a pointer to an object -
Date: Fri, 15 Jul 2016 23:31:03 +0200	[thread overview]
Message-ID: <20160715213103.GA7335@britannica.bec.de> (raw)
In-Reply-To: <15489725859697430873.enqueue@fantadrom.bsd.lv>

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

      reply	other threads:[~2016-07-15 21:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-15 19:33 schwarze
2016-07-15 21:31 ` Joerg Sonnenberger [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160715213103.GA7335@britannica.bec.de \
    --to=joerg@mdocml.bsd.lv \
    --cc=source@mdocml.bsd.lv \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).