Re: endianness and sparse warnings

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Geert Uytterhoeven
Date: Monday, September 1, 2008 - 2:23 am

On Fri, 29 Aug 2008, Harvey Harrison wrote:

Indeed, if you have a void/char *, this works, and there's not much annotation
you can do here.

But please consider this case:

    struct xxx {
	u8 a;
	__le16 b;
    } __attribute__ ((packed));

    struct xxx *p;
    u16 foo = get_unaligned_le16(&p->b);

Here you could have typechecking.
Note that a `get_unaligned_le()' that handles different sizes automatically
would work.


So perhaps we want a public get_unaligned_[bl]e() for the case above?

With kind regards,

Geert Uytterhoeven
Software Architect

Sony Techsoft Centre Europe
The Corporate Village
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
endianness and sparse warnings, Geert Uytterhoeven, (Fri Aug 29, 7:54 am)
Re: endianness and sparse warnings, Harvey Harrison, (Fri Aug 29, 9:24 am)
Re: endianness and sparse warnings, Geert Uytterhoeven, (Mon Sep 1, 2:23 am)