Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755459AbYAPWa0 (ORCPT ); Wed, 16 Jan 2008 17:30:26 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755889AbYAPWUx (ORCPT ); Wed, 16 Jan 2008 17:20:53 -0500 Received: from relay1.sgi.com ([192.48.171.29]:48924 "EHLO relay.sgi.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755594AbYAPWUw (ORCPT ); Wed, 16 Jan 2008 17:20:52 -0500 Date: Wed, 16 Jan 2008 14:20:50 -0800 (PST) From: Christoph Lameter X-X-Sender: clameter@schroedinger.engr.sgi.com To: Johannes Weiner cc: Linus Torvalds , Linux Kernel Mailing List , penberg@cs.helsinki.fi Subject: Re: Why is the kfree() argument const? In-Reply-To: <87odblct19.fsf@saeurebad.de> Message-ID: References: <87lk6pvii0.fsf@saeurebad.de> <87odblct19.fsf@saeurebad.de> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 662 Lines: 15 On Wed, 16 Jan 2008, Johannes Weiner wrote: > So if I got it right and you actually modify the memory you only got a > const pointer to, you reach a level where you _have to_ break this > policy and cast to a non-const pointer, as it is currently done in > kfree(). No? 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? -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/