Re: [PATCH] creds: suppress warning in get_cred

From: David Howells
Date: Mon Jan 19 2009 - 15:19:29 EST


Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx> wrote:

> 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.

I believe that within the kernel, unsigned long is guaranteed to be the same
size as a pointer; so much code will break if this is not true.

> 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.
>
> So, your choice.

I don't mind you putting the cast in, but I'd prefer the cast to be via
unsigned long, and I think it should have a comment to indicate why the extra
cast is necessary.

David
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/