Re: [PATCH 3/4] mtd: ubi: Compile fastmap.c with -Wno-address-of-packed-member

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

 



On Mon, Sep 9, 2019 at 3:23 AM Sascha Hauer <s.hauer@xxxxxxxxxxxxxx> wrote:
>
> On Sat, Sep 07, 2019 at 04:54:55PM -0700, Andrey Smirnov wrote:
> > GCC9 for ARM produces the following warnings:
> >
> > fastmap.c: In function 'ubi_attach_fastmap':
> > fastmap.c:700:31: warning: taking address of packed member of 'struct ubi_fm_scan_pool' may result in an unaligned pointer value [-Waddress-of-packed-member]
> >   700 |  ret = scan_pool(ubi, ai, fmpl->pebs, pool_size, &max_sqnum, &lfree);
> >       |                           ~~~~^~~~~~
> > fastmap.c:704:34: warning: taking address of packed member of 'struct ubi_fm_scan_pool' may result in an unaligned pointer value [-Waddress-of-packed-member]
> >   704 |  ret = scan_pool(ubi, ai, fmpl_wl->pebs, wl_pool_size, &max_sqnum, &lfree);
> >       |                           ~~~~~~~^~~~~~
> >
> > the offending code seems OK and there doesn't seem to be a way to fix
> > this in code, so disable the warning for that file.
> >
> > Signed-off-by: Andrey Smirnov <andrew.smirnov@xxxxxxxxx>
> > ---
>
> Linux disables this warning completely.

Yeah, I saw that. Wasn't sure if we wanted to go that direction or not.

> We just burnt some developer
> cycles, came to the conclusion that the world isn't perfect, that
> there's no good (at least good realistic) solution to this problem and
> that we should just do the same as Linux.
>
> Disabling this warning for individual files in which it triggers
> probably doesn't bring us further.
>

Sure, will do. I think "ratp: Mark struct ratp_bb as packed" might
still be worth applying though.

Thanks,
Andrey Smirnov

_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux