Skip to content

Commit

Permalink
8081 Compiler warnings in zdb
Browse files Browse the repository at this point in the history
Reviewed by: Matthew Ahrens <[email protected]>
Reviewed by: Prakash Surya <[email protected]>

Fix compiler warnings in zdb.  With these changes, FreeBSD can compile
zdb with all compiler warnings enabled save -Wunused-parameter.

usr/src/cmd/zdb/Makefile.com
	Enable some compiler warnings

usr/src/cmd/zdb/zdb.c
usr/src/cmd/zdb/zdb_il.c
usr/src/uts/common/fs/zfs/sys/sa.h
usr/src/uts/common/fs/zfs/sys/spa.h
	Fix numerous warnings, including:
	* const-correctness
	* shadowing global definitions
	* signed vs unsigned comparisons
	* missing prototypes, or missing static declarations
	* unused variables and functions
	* Unreadable array initializations
	* Missing struct initializers

usr/src/cmd/zdb/zdb.h
	Add a header file to declare common symbols

usr/src/lib/libzpool/common/sys/zfs_context.h
usr/src/uts/common/fs/zfs/arc.c
usr/src/uts/common/fs/zfs/dbuf.c
usr/src/uts/common/fs/zfs/spa.c
usr/src/uts/common/fs/zfs/txg.c
	Add a function prototype for zk_thread_create, and ensure that every
	callback supplied to this function actually matches the prototype.

usr/src/cmd/ztest/ztest.c
usr/src/uts/common/fs/zfs/sys/zil.h
usr/src/uts/common/fs/zfs/zfs_replay.c
usr/src/uts/common/fs/zfs/zvol.c
	Add a function prototype for zil_replay_func_t, and ensure that
	every function of this type actually matches the prototype.

usr/src/uts/common/fs/zfs/sys/refcount.h
	Change FTAG so it discards any constness of __func__, necessary
	since existing APIs expect it passed as void *.

Closes openzfs#354
  • Loading branch information
asomers authored and Prakash Surya committed Sep 27, 2017
1 parent 37362a6 commit 843abe1
Show file tree
Hide file tree
Showing 16 changed files with 263 additions and 150 deletions.
6 changes: 5 additions & 1 deletion usr/src/cmd/zdb/Makefile.com
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ CFLAGS += $(CCVERBOSE)
CFLAGS64 += $(CCVERBOSE)
CPPFLAGS += -D_LARGEFILE64_SOURCE=1 -D_REENTRANT $(INCS) -DDEBUG

CERRWARN += -_gcc=-Wno-uninitialized
# re-enable warnings that we can tolerate, which are disabled by default
# in Makefile.master
CERRWARN += -_gcc=-Wmissing-braces
CERRWARN += -_gcc=-Wsign-compare
CERRWARN += -_gcc=-Wmissing-field-initializers

# lint complains about unused _umem_* functions
LINTFLAGS += -xerroff=E_NAME_DEF_NOT_USED2
Expand Down
Loading

0 comments on commit 843abe1

Please sign in to comment.