[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] Add info commands for serial/parallel devices
From: |
M. Warner Losh |
Subject: |
Re: [Qemu-devel] [PATCH] Add info commands for serial/parallel devices |
Date: |
Tue, 20 Mar 2007 08:48:40 -0600 (MDT) |
In message: <address@hidden>
Anthony Liguori <address@hidden> 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