From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HTfhM-0005HM-Aa for qemu-devel@nongnu.org; Tue, 20 Mar 2007 10:52:28 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HTfhK-0005Ch-TC for qemu-devel@nongnu.org; Tue, 20 Mar 2007 10:52:28 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HTfhK-0005Ce-Q5 for qemu-devel@nongnu.org; Tue, 20 Mar 2007 09:52:26 -0500 Received: from vc4-2-0-87.dsl.netrack.net ([199.45.160.85] helo=harmony.bsdimp.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1HTffk-0007Vp-K8 for qemu-devel@nongnu.org; Tue, 20 Mar 2007 10:50:48 -0400 Date: Tue, 20 Mar 2007 08:48:40 -0600 (MDT) Message-Id: <20070320.084840.-1962670054.imp@bsdimp.com> Subject: Re: [Qemu-devel] [PATCH] Add info commands for serial/parallel devices From: "M. Warner Losh" In-Reply-To: <45FFEA44.7040703@codemonkey.ws> References: <45EA3F28.5030807@codemonkey.ws> <20070319161342.GC28895@networkno.de> <45FFEA44.7040703@codemonkey.ws> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, anthony@codemonkey.ws In message: <45FFEA44.7040703@codemonkey.ws> Anthony Liguori 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