mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 10:37:35 +03:00
Replace ASSERTV macro with compiler annotation
Remove the ASSERTV macro and handle suppressing unused compiler warnings for variables only in ASSERTs using the __attribute__((unused)) compiler annotation. The annotation is understood by both gcc and clang. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Jorgen Lundman <lundman@lundman.net> Signed-off-by: Matt Macy <mmacy@FreeBSD.org> Closes #9671
This commit is contained in:
committed by
Brian Behlendorf
parent
12395c7b0b
commit
2a8ba608d3
@@ -145,7 +145,6 @@ do { \
|
||||
#define ASSERT0(x) ((void)0)
|
||||
#define ASSERT(x) ((void)0)
|
||||
#define assert(x) ((void)0)
|
||||
#define ASSERTV(x)
|
||||
#define IMPLY(A, B) ((void)0)
|
||||
#define EQUIV(A, B) ((void)0)
|
||||
#else
|
||||
@@ -156,7 +155,6 @@ do { \
|
||||
#define ASSERT0 VERIFY0
|
||||
#define ASSERT VERIFY
|
||||
#define assert VERIFY
|
||||
#define ASSERTV(x) x
|
||||
#define IMPLY(A, B) \
|
||||
((void)(((!(A)) || (B)) || \
|
||||
libspl_assert("(" #A ") implies (" #B ")", \
|
||||
|
||||
@@ -33,4 +33,8 @@
|
||||
#define __printflike(x, y) __attribute__((__format__(__printf__, x, y)))
|
||||
#endif
|
||||
|
||||
#ifndef __maybe_unused
|
||||
#define __maybe_unused __attribute__((unused))
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user