From 6fda813ce8e3ac129628e51253640fb2c92117f6 Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Fri, 5 May 2023 12:11:20 +0200 Subject: [PATCH] Fix build for AVR MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes the overflowing left shift on 8 bit platforms. littlefs2/lfs.c: In function ‘lfs_dir_commitcrc’: littlefs2/lfs.c:1654:51: error: left shift count >= width of type [-Werror=shift-count-overflow] commit->ptag = ntag ^ ((0x80 & ~eperturb) << 24); --- lfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lfs.c b/lfs.c index d2f3b5e9..f0daf540 100644 --- a/lfs.c +++ b/lfs.c @@ -1651,7 +1651,7 @@ static int lfs_dir_commitcrc(lfs_t *lfs, struct lfs_commit *commit) { commit->off = noff; // perturb valid bit? - commit->ptag = ntag ^ ((0x80 & ~eperturb) << 24); + commit->ptag = ntag ^ ((0x80UL & ~eperturb) << 24); // reset crc for next commit commit->crc = 0xffffffff;