Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 02 Apr 2026 11:22:18 +0000
From:      Dag-Erling=?utf-8?Q? Sm=C3=B8rg?=rav <des@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: c5e79c7e93dd - main - tunefs: Don't lower WARNS
Message-ID:  <69ce516a.1f00d.cff8957@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by des:

URL: https://cgit.FreeBSD.org/src/commit/?id=c5e79c7e93dda07c383be9b99a1a91894652f546

commit c5e79c7e93dda07c383be9b99a1a91894652f546
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-02 11:22:14 +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
---
 sbin/tunefs/Makefile | 2 --
 sbin/tunefs/tunefs.c | 6 +++---
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/sbin/tunefs/Makefile b/sbin/tunefs/Makefile
index 4ea2219c8e03..56238b5ef673 100644
--- a/sbin/tunefs/Makefile
+++ b/sbin/tunefs/Makefile
@@ -3,6 +3,4 @@ PROG=	tunefs
 LIBADD=	ufs util
 MAN=	tunefs.8
 
-WARNS?=	3
-
 .include <bsd.prog.mk>
diff --git a/sbin/tunefs/tunefs.c b/sbin/tunefs/tunefs.c
index d5ef366e8221..d0f506557d65 100644
--- a/sbin/tunefs/tunefs.c
+++ b/sbin/tunefs/tunefs.c
@@ -640,7 +640,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)
@@ -705,7 +705,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;
@@ -728,7 +728,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;


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69ce516a.1f00d.cff8957>