[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] Re: [PATCH 07/17] block/vvfat.c: fix warnings with _FOR
From: |
Jamie Lokier |
Subject: |
Re: [Qemu-devel] Re: [PATCH 07/17] block/vvfat.c: fix warnings with _FORTIFY_SOURCE |
Date: |
Wed, 20 Jan 2010 16:16:07 +0000 |
User-agent: |
Mutt/1.5.13 (2006-08-11) |
Kirill A. Shutemov wrote:
> On Wed, Jan 20, 2010 at 3:03 PM, Markus Armbruster <address@hidden> wrote:
> > "Kirill A. Shutemov" <address@hidden> writes:
> >> No, compiler can't add anything between. 'char' is always byte-aligned.
> >
> > You got some reading to do then.
>
> Do you want to say that it's not true? Could you provide an example
> when 'char' isn't byte-aligned?
I have no example, but that doesn't mean there is no architecture, ABI
or host OS where it happens. Architectures can be surprising.
It's very easy to make assumptions which break on some architecture
you've never tested on.
Take this code:
struct part1 {
char c[5];
};
struct part2 {
char c[3];
};
struct all {
struct part1 p1;
struct part2 p2;
};
What do you think the size is on ARM? Hint: not 8 when using GCC < 4,
but it is 8 when using current GCC and the later ARM ABI.
This broke some data parsing application when it was ported from x86
to ARM, because of a wrong assumption about structure layout that
works on nearly all architectures and passed all testing prior to the port.
-- Jamie
- Re: [Qemu-devel] Re: [PATCH 07/17] block/vvfat.c: fix warnings with _FORTIFY_SOURCE, (continued)
- Re: [Qemu-devel] Re: [PATCH 07/17] block/vvfat.c: fix warnings with _FORTIFY_SOURCE, Kevin Wolf, 2010/01/20
- Re: [Qemu-devel] Re: [PATCH 07/17] block/vvfat.c: fix warnings with _FORTIFY_SOURCE, Markus Armbruster, 2010/01/20
- Re: [Qemu-devel] Re: [PATCH 07/17] block/vvfat.c: fix warnings with _FORTIFY_SOURCE, Kirill A. Shutemov, 2010/01/20
- Re: [Qemu-devel] Re: [PATCH 07/17] block/vvfat.c: fix warnings with _FORTIFY_SOURCE, Markus Armbruster, 2010/01/20
- Re: [Qemu-devel] Re: [PATCH 07/17] block/vvfat.c: fix warnings with _FORTIFY_SOURCE, Gleb Natapov, 2010/01/20
- Re: [Qemu-devel] Re: [PATCH 07/17] block/vvfat.c: fix warnings with _FORTIFY_SOURCE, Kirill A. Shutemov, 2010/01/20
- Re: [Qemu-devel] Re: [PATCH 07/17] block/vvfat.c: fix warnings with _FORTIFY_SOURCE, Gleb Natapov, 2010/01/20
- Re: [Qemu-devel] Re: [PATCH 07/17] block/vvfat.c: fix warnings with _FORTIFY_SOURCE, malc, 2010/01/20
- Re: [Qemu-devel] Re: [PATCH 07/17] block/vvfat.c: fix warnings with _FORTIFY_SOURCE, Kirill A. Shutemov, 2010/01/20
- Re: [Qemu-devel] Re: [PATCH 07/17] block/vvfat.c: fix warnings with _FORTIFY_SOURCE, Markus Armbruster, 2010/01/20
- Re: [Qemu-devel] Re: [PATCH 07/17] block/vvfat.c: fix warnings with _FORTIFY_SOURCE,
Jamie Lokier <=
- Re: [Qemu-devel] Re: [PATCH 07/17] block/vvfat.c: fix warnings with _FORTIFY_SOURCE, Anthony Liguori, 2010/01/20
[Qemu-devel] [PATCH 09/17] net/slirp.c: fix warning with _FORTIFY_SOURCE, Juan Quintela, 2010/01/19
[Qemu-devel] [PATCH 11/17] vl.c: fix warning with _FORTIFY_SOURCE, Juan Quintela, 2010/01/19
[Qemu-devel] [PATCH 08/17] block/qcow2.c: fix warnings with _FORTIFY_SOURCE, Juan Quintela, 2010/01/19
[Qemu-devel] [PATCH 12/17] monitor.c: fix warnings with _FORTIFY_SOURCE, Juan Quintela, 2010/01/19
[Qemu-devel] [PATCH 10/17] usb-linux.c: fix warning with _FORTIFY_SOURCE, Juan Quintela, 2010/01/19
[Qemu-devel] [PATCH 13/17] linux-user/mmap.c: fix warnings with _FORTIFY_SOURCE, Juan Quintela, 2010/01/19
[Qemu-devel] [PATCH 14/17] check pipe() return value, Juan Quintela, 2010/01/19
[Qemu-devel] [PATCH 15/17] Enable _FORTIFY_SOURCE=2, Juan Quintela, 2010/01/19
[Qemu-devel] [PATCH 16/17] Check availavility of -fstack-protector-all, Juan Quintela, 2010/01/19