lkml.org 
[lkml]   [2006]   [Oct]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC] typechecking for get_unaligned/put_unaligned


On Tue, 17 Oct 2006, Al Viro wrote:
>
> What kind of typechecking do we want for those?
>
> AFAICS, current constraints are
> * {put,get}_unaligned() should be passed a pointer to object; void *
> is not acceptable
> * sizeof(*ptr) should be one of 1, 2, 4, 8
> * assignment of val to *ptr should be valid C.

Have we ever really had any problems with this?

I think that as far as typing, we should just make sure that
[get|put]_unaligned() has the same behaviour as a dereference. Sure,
checking the size might be worth it, but it doesn't sound like we'd
actually find any real bugs (ie wrong sizes should just result in compile
or link errors on architectures where you need special code for it).

> c) how about gradually switching to linux/unaligned.h?

I'd prefer not to, if only because it's an unnecessary compile-time
overhead for nice sane architectures like x86, which don't need any of the
unaligned crap.

Since x86[-64] is clearly the main architecture, dis-optimizing for that
one sounds like a bad idea.

Linus
-
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/

\
 
 \ /
  Last update: 2009-11-18 23:46    [W:0.982 / U:1.188 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site