From 0083a2e4f29ac8574eeda895803f2a7447d89680 Mon Sep 17 00:00:00 2001 From: liyi Date: Thu, 4 Aug 2022 14:54:31 +0800 Subject: [PATCH] optimize UNUSED macro Signed-off-by: liyi --- include/nuttx/compiler.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/nuttx/compiler.h b/include/nuttx/compiler.h index 5aef5b519e..6fd4524789 100644 --- a/include/nuttx/compiler.h +++ b/include/nuttx/compiler.h @@ -385,7 +385,7 @@ /* Indicate that a local variable is not used */ -# define UNUSED(a) ((void)(1 || (a))) +# define UNUSED(a) ((void)(1 || &(a))) # if defined(__clang__) # define no_builtin(n) __attribute__((no_builtin(n))) @@ -485,7 +485,7 @@ /* Indicate that a local variable is not used */ -# define UNUSED(a) ((void)(1 || (a))) +# define UNUSED(a) ((void)(1 || &(a))) /* It is assumed that the system is build using the small * data model with storage defaulting to internal RAM. @@ -654,7 +654,7 @@ /* Indicate that a local variable is not used */ -# define UNUSED(a) ((void)(1 || (a))) +# define UNUSED(a) ((void)(1 || &(a))) /* Older Zilog compilers support both types double and long long, but the * size is 32-bits (same as long and single precision) so it is safer to say @@ -721,7 +721,7 @@ /* Indicate that a local variable is not used */ -# define UNUSED(a) ((void)(1 || (a))) +# define UNUSED(a) ((void)(1 || &(a))) # define CONFIG_CPP_HAVE_VARARGS 1 /* Supports variable argument macros */ # define CONFIG_HAVE_FILENAME 1 /* Has __FILE__ */ @@ -783,7 +783,7 @@ # undef CONFIG_HAVE_DOUBLE # undef CONFIG_HAVE_LONG_DOUBLE -# define UNUSED(a) ((void)(1 || (a))) +# define UNUSED(a) ((void)(1 || &(a))) # define offsetof(a, b) ((size_t)(&(((a *)(0))->b)))