git: 83a0bced4ef0 - stable/14 - tunefs: Don't lower WARNS
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 04 Apr 2026 08:59:33 UTC
The branch stable/14 has been updated by des:
URL: https://cgit.FreeBSD.org/src/commit/?id=83a0bced4ef0e001ad2a0a8c403dbd0703780ce3
commit 83a0bced4ef0e001ad2a0a8c403dbd0703780ce3
Author: Dag-Erling Smørgrav <des@FreeBSD.org>
AuthorDate: 2026-04-02 11:21:59 +0000
Commit: Dag-Erling Smørgrav <des@FreeBSD.org>
CommitDate: 2026-04-04 08:59:25 +0000
tunefs: Don't lower WARNS
Use casts to silence the alignment warnings instead of potentially
suppressing other legitimate warnings.
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D56033
(cherry picked from commit c5e79c7e93dda07c383be9b99a1a91894652f546)
tunefs: Fix alignment warning on arm64
MFC after: 1 week
Fixes: c5e79c7e93dd ("tunefs: Don't lower WARNS")
Reviewed by: bakul
Differential Revision: https://reviews.freebsd.org/D56229
(cherry picked from commit 616f47f176c308a29b1f4a6bba1b1a4dc01c3091)
---
sbin/tunefs/Makefile | 2 --
sbin/tunefs/tunefs.c | 8 ++++----
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/sbin/tunefs/Makefile b/sbin/tunefs/Makefile
index e78c3fe671c2..de9529386071 100644
--- a/sbin/tunefs/Makefile
+++ b/sbin/tunefs/Makefile
@@ -10,6 +10,4 @@ MOUNT= ${SRCTOP}/sbin/mount
CFLAGS+= -I${MOUNT}
.PATH: ${MOUNT}
-WARNS?= 3
-
.include <bsd.prog.mk>
diff --git a/sbin/tunefs/tunefs.c b/sbin/tunefs/tunefs.c
index 6b399f032c9c..4dbdaf3db574 100644
--- a/sbin/tunefs/tunefs.c
+++ b/sbin/tunefs/tunefs.c
@@ -652,7 +652,7 @@ dir_search(ufs2_daddr_t blk, int bytes)
return (-1);
}
for (off = 0; off < bytes; off += dp->d_reclen) {
- dp = (struct direct *)&block[off];
+ dp = (struct direct *)(uintptr_t)&block[off];
if (dp->d_reclen == 0)
break;
if (dp->d_ino == 0)
@@ -717,7 +717,7 @@ dir_clear_block(const char *block, off_t off)
struct direct *dp;
for (; off < sblock.fs_bsize; off += DIRBLKSIZ) {
- dp = (struct direct *)&block[off];
+ dp = (struct direct *)(uintptr_t)&block[off];
dp->d_ino = 0;
dp->d_reclen = DIRBLKSIZ;
dp->d_type = DT_UNKNOWN;
@@ -740,7 +740,7 @@ dir_insert(ufs2_daddr_t blk, off_t off, ino_t ino)
return (-1);
}
bzero(&block[off], sblock.fs_bsize - off);
- dp = (struct direct *)&block[off];
+ dp = (struct direct *)(uintptr_t)&block[off];
dp->d_ino = ino;
dp->d_reclen = DIRBLKSIZ;
dp->d_type = DT_REG;
@@ -867,7 +867,7 @@ indir_fill(ufs2_daddr_t blk, int level, int *resid)
int i;
bzero(indirbuf, sizeof(indirbuf));
- bap1 = (ufs1_daddr_t *)indirbuf;
+ bap1 = (ufs1_daddr_t *)(uintptr_t)indirbuf;
bap2 = (void *)bap1;
cnt = 0;
for (i = 0; i < NINDIR(&sblock) && *resid != 0; i++) {