Re: [patch-2.4.0-test2]Re: Linux-2.4.0-test2

From: Rusty Russell (rusty@linuxcare.com.au)
Date: Sun Jun 25 2000 - 01:56:34 EST


In message <20000624205959.A3000@gruyere.muc.suse.de> you write:
> Linux kernel is not writen in ANSI-C. It makes certain assumptions about
> the environment which are not guaranteed by the standard. One of them
> is that void * fits into unsigned long. Another is that no structure elements
> get have a bigger alignment than their size (so u32 gets at worst 3 bytes
> alignment and u8/u16 can be used to pad that explicitely ). If a machine
> cannot satisfy that maybe it should look for a different kernel.

But we don't assume:
        union {
                TYPE t1;
                TYPE t2;
                TYPE t3;
        } union_TYPE;

sizeof(union_TYPE) == sizeof(TYPE) because the ARM breaks this...

So these `sane alignment' rules should be documented somewhere,
Rusty.

--
Hacking time.

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



This archive was generated by hypermail 2b29 : Mon Jun 26 2000 - 21:00:08 EST