Re: Plan needed for switching m68k to 32-bit alignment

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Oct 27, 2024 at 7:16 AM Finn Thain <fthain@xxxxxxxxxxxxxx> wrote:
On Sun, 27 Oct 2024, Thorsten Glaser wrote:
Finn Thain dixit:

That would mean __alignof__(foo.b) == sizeof(foo.b) but that's not the
case on my Linux/i686 system. 4 != 8:

struct baa {
       int a;
       long long b;
} foo;

That struct is just 12 bytes for you then?

Right. i686 and m68k agree on that.

On i686 (i.e. gcc -m32 on amd64):

    __alignof__(long long) = 8

but

    sizeof(struct baa) = 12
    __alignof__(struct baa) = 4

???
Isn't the alignment of a struct the largest alignment of any of its members?

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds





[Index of Archives]     [Video for Linux]     [Yosemite News]     [Linux S/390]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux