From: Rui Salvaterra Date: Tue, 7 May 2024 12:56:05 +0000 (+0100) Subject: mtd: fix build with GCC 14 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=da0cd9d764a39ef60b1594b82721d77b241034d4;p=openwrt%2Fstaging%2Fnbd.git mtd: fix build with GCC 14 Also fix a couple of warnings while at it. Signed-off-by: Rui Salvaterra --- diff --git a/package/system/mtd/src/trx.c b/package/system/mtd/src/trx.c index d7c5d832c4..494cc3c91e 100644 --- a/package/system/mtd/src/trx.c +++ b/package/system/mtd/src/trx.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -165,7 +166,7 @@ mtd_fixtrx(const char *mtd, size_t offset, size_t data_size) size_t block_offset; if (quiet < 2) - fprintf(stderr, "Trying to fix trx header in %s at 0x%x...\n", mtd, offset); + fprintf(stderr, "Trying to fix trx header in %s at 0x%zx...\n", mtd, offset); fd = mtd_check_open(mtd); if(fd < 0) { @@ -246,7 +247,7 @@ mtd_fixtrx(const char *mtd, size_t offset, size_t data_size) trx->crc32 = STORE32_LE(crc32buf(buf, data_size)); if (mtd_erase_block(fd, block_offset)) { - fprintf(stderr, "Can't erease block at 0x%x (%s)\n", block_offset, strerror(errno)); + fprintf(stderr, "Can't erease block at 0x%zx (%s)\n", block_offset, strerror(errno)); exit(1); }