From: "M. Warner Losh" <imp@bsdimp.com>
To: qemu-devel@nongnu.org, anthony@codemonkey.ws
Subject: Re: [Qemu-devel] [PATCH] Add info commands for serial/parallel devices
Date: Tue, 20 Mar 2007 08:48:40 -0600 (MDT) [thread overview]
Message-ID: <20070320.084840.-1962670054.imp@bsdimp.com> (raw)
In-Reply-To: <45FFEA44.7040703@codemonkey.ws>
In message: <45FFEA44.7040703@codemonkey.ws>
Anthony Liguori <anthony@codemonkey.ws> writes:
: To me, const char * always implies that you don't own the memory. This
: is helped by the fact that free doesn't take a const void * and newer
: GCC's will complain if you free() a const char *.
Sadly, this is a bug, as it precludes the use pattern of initializing
char * data, casting it to const char * (a valid cast) and then
relying on the compiler to thereafter enforce its constness.
Const does *NOT* imply that you don't own the memory. Its narrow
meaning is just that the object won't be changed through this
pointer/reference.
Warner
next prev parent reply other threads:[~2007-03-20 14:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-04 3:38 [Qemu-devel] [PATCH] Add info commands for serial/parallel devices Anthony Liguori
2007-03-19 16:13 ` Thiemo Seufer
2007-03-20 14:05 ` Anthony Liguori
2007-03-20 14:48 ` M. Warner Losh [this message]
2007-03-20 15:02 ` Andreas Schwab
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=20070320.084840.-1962670054.imp@bsdimp.com \
--to=imp@bsdimp.com \
--cc=anthony@codemonkey.ws \
--cc=qemu-devel@nongnu.org \
/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).