Skip to content

Commit 6fda813

Browse files
committed
Fix build for AVR
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);
1 parent ec3ec86 commit 6fda813

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1651,7 +1651,7 @@ static int lfs_dir_commitcrc(lfs_t *lfs, struct lfs_commit *commit) {
16511651

16521652
commit->off = noff;
16531653
// perturb valid bit?
1654-
commit->ptag = ntag ^ ((0x80 & ~eperturb) << 24);
1654+
commit->ptag = ntag ^ ((0x80UL & ~eperturb) << 24);
16551655
// reset crc for next commit
16561656
commit->crc = 0xffffffff;
16571657

0 commit comments

Comments
 (0)