From 4f1e09e2d012aee92aa2836439f1307fd3eda46c Mon Sep 17 00:00:00 2001 From: dim Date: Fri, 23 Mar 2012 11:01:04 +0000 Subject: [PATCH] MFC r232749: Partially undo r228693, by removing NO_WFORMAT.clang in fsdb's Makefile, and fixing the format string in sbin/fsdb/fsdbutil.c instead. Note the remark "Work around a problem with format string warnings and ntohs macros" was actually incorrect. The DIP(dp, di_nlink) macro invocation actually returned an int, due to its ternary expression, even though the di_nlink members of struct ufs1_dinode and struct ufs2_dinode are both defined as int16_t. git-svn-id: svn://svn.freebsd.org/base/stable/9@233351 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- sbin/fsdb/Makefile | 2 -- sbin/fsdb/fsdbutil.c | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/sbin/fsdb/Makefile b/sbin/fsdb/Makefile index 5e172fd78..65333ef07 100644 --- a/sbin/fsdb/Makefile +++ b/sbin/fsdb/Makefile @@ -9,8 +9,6 @@ SRCS= fsdb.c fsdbutil.c \ pass5.c setup.c utilities.c ffs_subr.c ffs_tables.c CFLAGS+= -I${.CURDIR}/../fsck_ffs WARNS?= 2 -# Work around a problem with format string warnings and ntohs macros. -NO_WFORMAT.clang= LDADD= -ledit -ltermcap DPADD= ${LIBEDIT} ${LIBTERMCAP} .PATH: ${.CURDIR}/../fsck_ffs ${.CURDIR}/../../sys/ufs/ffs diff --git a/sbin/fsdb/fsdbutil.c b/sbin/fsdb/fsdbutil.c index 0fcbd9f10..3c8f4e402 100644 --- a/sbin/fsdb/fsdbutil.c +++ b/sbin/fsdb/fsdbutil.c @@ -195,7 +195,7 @@ printstat(const char *cp, ino_t inum, union dinode *dp) blocks = DIP(dp, di_blocks); gen = DIP(dp, di_gen); - printf("LINKCNT=%hd FLAGS=%#x BLKCNT=%jx GEN=%jx\n", DIP(dp, di_nlink), + printf("LINKCNT=%d FLAGS=%#x BLKCNT=%jx GEN=%jx\n", DIP(dp, di_nlink), DIP(dp, di_flags), (intmax_t)blocks, (intmax_t)gen); } -- 2.45.2