[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <154e089b0901190659g2a836fa0o6cbedd0396fef11c@mail.gmail.com>
Date: Mon, 19 Jan 2009 15:59:00 +0100
From: "Hannes Eder" <hannes@...neseder.net>
To: "Stephen Rothwell" <sfr@...b.auug.org.au>
Cc: "David Howells" <dhowells@...hat.com>,
"James Morris" <jmorris@...ei.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] creds: suppress warning in get_cred
On Mon, Jan 19, 2009 at 3:52 PM, Stephen Rothwell <sfr@...b.auug.org.au> wrote:
> Hi David,
>
> On Mon, 19 Jan 2009 12:29:31 +0000 David Howells <dhowells@...hat.com> wrote:
>>
>> Stephen Rothwell <sfr@...b.auug.org.au> wrote:
>>
>> > + return get_new_cred((struct cred *)(uintptr_t)cred);
>>
>> That should probably be 'unsigned long' within the kernel. This is also a
>> compiler bug, but I think we can live with this fix.
>
> We do have uintptr_t inside the kernel (it is typedeffed to unsigned
> long) but I used it explicitly because its type is defined to be large
> enough to store any pointer.
When working around this compiler bug would it be better to do it like this:
+ return get_new_cred((struct cred *)(void *)cred);
instead of relying on the size of a pointer and using an large enough
integer data type?
Maybe would should just add a comment, to note that if such a warning
is issued, that
this is a compiler bug.
Or disable the warning for this region, but as far as I know gcc _does
not_ have this feature yet.
> However, I have also verified that using a newer compiler (4.3.2 in my
> case) makes the warning go away as Hannes Eder pointed out when
> mentioning his earlier patch.
Hannes
--
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