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.

MFC after:	2 weeks
This commit is contained in:
Dimitry Andric 2012-03-09 21:02:39 +00:00
parent 6aa83769fd
commit 24c8f29cf4
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=232749
2 changed files with 1 additions and 3 deletions

View File

@ -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

View File

@ -193,7 +193,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);
}