[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <alpine.LFD.1.00.0801161517090.2806@woody.linux-foundation.org>
Date: Wed, 16 Jan 2008 15:18:33 -0800 (PST)
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Christoph Lameter <clameter@....com>
cc: Johannes Weiner <hannes@...urebad.de>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
penberg@...helsinki.fi
Subject: Re: Why is the kfree() argument const?
On Wed, 16 Jan 2008, Christoph Lameter wrote:
>
> Correct and we have gcc 4.2 currently spitting out warnings because of
> casting to non const. Any idea how to convince gcc that this is okay?
Either don't use a broken compiler (casting a const pointer to a non-const
is definitely not a bug), or cast to "unsigned long" (if it still
complains, now the compiler is not just stupid, it's broken).
The whole point of memory management is that we know how pointers work,
and understand that they have a *bit* representation, not just the C
semantics.
Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists