[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]

 



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>
---
 drivers/mtd/ubi/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mtd/ubi/Makefile b/drivers/mtd/ubi/Makefile
index 33ac39026c..6ffb4ae2bc 100644
--- a/drivers/mtd/ubi/Makefile
+++ b/drivers/mtd/ubi/Makefile
@@ -2,4 +2,5 @@ obj-$(CONFIG_MTD_UBI) += ubi.o
 
 ubi-y += vtbl.o vmt.o upd.o build.o barebox.o kapi.o eba.o io.o wl.o attach.o
 ubi-y += misc.o debug.o
+CFLAGS_fastmap.o := -Wno-address-of-packed-member
 ubi-$(CONFIG_MTD_UBI_FASTMAP) += fastmap.o
-- 
2.21.0


_______________________________________________
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