diff options
author | Matthew Macy <[email protected]> | 2019-12-05 12:37:00 -0800 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2019-12-05 12:37:00 -0800 |
commit | 2a8ba608d3eace43010174aa4f67c8b8af4aacf3 (patch) | |
tree | b6393b38c9f31ee69fac7f42414b09ca900f2737 /include/os/linux | |
parent | 12395c7b0bbd2eaaae96d4105bdc83c3d0c73bec (diff) |
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 <[email protected]>
Reviewed-by: Jorgen Lundman <[email protected]>
Signed-off-by: Matt Macy <[email protected]>
Closes #9671
Diffstat (limited to 'include/os/linux')
-rw-r--r-- | include/os/linux/spl/sys/debug.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/include/os/linux/spl/sys/debug.h b/include/os/linux/spl/sys/debug.h index 8fad3bef6..ed085fe8a 100644 --- a/include/os/linux/spl/sys/debug.h +++ b/include/os/linux/spl/sys/debug.h @@ -52,6 +52,10 @@ */ #define __printflike(a, b) __printf(a, b) +#ifndef __maybe_unused +#define __maybe_unused __attribute__((unused)) +#endif + int spl_panic(const char *file, const char *func, int line, const char *fmt, ...); void spl_dumpstack(void); @@ -132,7 +136,6 @@ void spl_dumpstack(void); #ifdef NDEBUG #define ASSERT(x) ((void)0) -#define ASSERTV(x) #define ASSERT3B(x,y,z) ((void)0) #define ASSERT3S(x,y,z) ((void)0) #define ASSERT3U(x,y,z) ((void)0) @@ -152,7 +155,6 @@ void spl_dumpstack(void); #define ASSERT3P VERIFY3P #define ASSERT0 VERIFY0 #define ASSERT VERIFY -#define ASSERTV(x) x #define IMPLY(A, B) \ ((void)(((!(A)) || (B)) || \ spl_panic(__FILE__, __FUNCTION__, __LINE__, \ |