Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 25 Sep 2021 08:41:24 GMT
From:      Piotr Pawel Stefaniak <pstef@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 8acee856bfc8 - stable/13 - fstyp: bump WARNS to default and work around warnings
Message-ID:  <202109250841.18P8fOPW017924@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by pstef:

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

commit 8acee856bfc8cf7ef0e2f622aeea5df830619db3
Author:     Piotr Pawel Stefaniak <pstef@FreeBSD.org>
AuthorDate: 2021-08-17 15:46:08 +0000
Commit:     Piotr Pawel Stefaniak <pstef@FreeBSD.org>
CommitDate: 2021-09-25 08:34:38 +0000

    fstyp: bump WARNS to default and work around warnings
    
    (cherry picked from commit da0c0e0121574a1d82f417cc7e245ecd5506325c)
---
 usr.sbin/fstyp/Makefile  | 2 --
 usr.sbin/fstyp/apfs.c    | 2 ++
 usr.sbin/fstyp/fstyp.c   | 4 ++--
 usr.sbin/fstyp/hammer.c  | 3 +++
 usr.sbin/fstyp/hfsplus.c | 2 ++
 5 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/usr.sbin/fstyp/Makefile b/usr.sbin/fstyp/Makefile
index 384e2f7dee60..161cd0cf3764 100644
--- a/usr.sbin/fstyp/Makefile
+++ b/usr.sbin/fstyp/Makefile
@@ -12,8 +12,6 @@ SRCS +=	zfs.c
 
 MAN=	fstyp.8
 
-WARNS?=	2
-
 .if ${MK_ICONV} == "yes"
 CFLAGS+=	-DWITH_ICONV
 .endif
diff --git a/usr.sbin/fstyp/apfs.c b/usr.sbin/fstyp/apfs.c
index 049a9f862f2b..7f8543a5a108 100644
--- a/usr.sbin/fstyp/apfs.c
+++ b/usr.sbin/fstyp/apfs.c
@@ -100,6 +100,8 @@ fstyp_apfs(FILE *fp, char *label, size_t size)
 	retval = 0;
 
 	/* No label support yet. */
+	(void)size;
+	(void)label;
 
 fail:
 	free(csb);
diff --git a/usr.sbin/fstyp/fstyp.c b/usr.sbin/fstyp/fstyp.c
index b39277914aed..91c36d9d9191 100644
--- a/usr.sbin/fstyp/fstyp.c
+++ b/usr.sbin/fstyp/fstyp.c
@@ -61,7 +61,7 @@ static struct {
 	const char	*name;
 	fstyp_function	function;
 	bool		unmountable;
-	char		*precache_encoding;
+	const char	*precache_encoding;
 } fstypes[] = {
 	{ "apfs", &fstyp_apfs, true, NULL },
 	{ "befs", &fstyp_befs, false, NULL },
@@ -206,7 +206,7 @@ main(int argc, char **argv)
 #ifdef WITH_ICONV
 	/* Cache iconv conversion data before entering capability mode. */
 	if (show_label) {
-		for (i = 0; i < nitems(fstypes); i++) {
+		for (i = 0; i < (int)nitems(fstypes); i++) {
 			iconv_t cd;
 
 			if (fstypes[i].precache_encoding == NULL)
diff --git a/usr.sbin/fstyp/hammer.c b/usr.sbin/fstyp/hammer.c
index 6fdad1d642a4..777f5d312371 100644
--- a/usr.sbin/fstyp/hammer.c
+++ b/usr.sbin/fstyp/hammer.c
@@ -43,6 +43,9 @@ __FBSDID("$FreeBSD$");
 
 #include "fstyp.h"
 
+extern int fsvtyp_hammer(const char *blkdevs, char *label, size_t size);
+extern int fsvtyp_hammer_partial(const char *blkdevs, char *label, size_t size);
+
 static hammer_volume_ondisk_t
 read_ondisk(FILE *fp)
 {
diff --git a/usr.sbin/fstyp/hfsplus.c b/usr.sbin/fstyp/hfsplus.c
index 71287465e4ff..3a94faf7766f 100644
--- a/usr.sbin/fstyp/hfsplus.c
+++ b/usr.sbin/fstyp/hfsplus.c
@@ -118,6 +118,8 @@ fstyp_hfsp(FILE *fp, char *label, size_t size)
 	retval = 0;
 
 	/* No label support yet. */
+	(void)size;
+	(void)label;
 
 fail:
 	free(hdr);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202109250841.18P8fOPW017924>