You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2022/04/05 14:57:56 UTC

[incubator-nuttx] branch master updated: include/nuttx: remove double definitions of UNUSED macro

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new ff0470d28a include/nuttx: remove double definitions of UNUSED macro
ff0470d28a is described below

commit ff0470d28a0875454f59fd6c87da0907d68ff6df
Author: Petro Karashchenko <pe...@gmail.com>
AuthorDate: Tue Apr 5 11:19:17 2022 +0200

    include/nuttx: remove double definitions of UNUSED macro
    
    Signed-off-by: Petro Karashchenko <pe...@gmail.com>
---
 include/nuttx/compiler.h | 34 +++++++++++++---------------------
 1 file changed, 13 insertions(+), 21 deletions(-)

diff --git a/include/nuttx/compiler.h b/include/nuttx/compiler.h
index 3772cf23d0..286530ea48 100644
--- a/include/nuttx/compiler.h
+++ b/include/nuttx/compiler.h
@@ -47,10 +47,6 @@
 #  define CONFIG_HAVE_FUNCTIONNAME 1 /* Has __FUNCTION__ */
 #  define CONFIG_HAVE_FILENAME     1 /* Has __FILE__ */
 
-/* Indicate that a local variable is not used */
-
-#  define UNUSED(a) ((void)(1 || (a)))
-
 /* Built-in functions */
 
 /* The <stddef.h> header shall define the following macros:
@@ -537,10 +533,6 @@
 #  undef  CONFIG_HAVE_DOUBLE
 #  undef  CONFIG_HAVE_LONG_DOUBLE
 
-/* Indicate that a local variable is not used */
-
-#  define UNUSED(a) ((void)(1 || (a)))
-
 #  define offsetof(a, b) ((size_t)(&(((a *)(0))->b)))
 
 #  define no_builtin(n)
@@ -668,6 +660,10 @@
 #  undef CONFIG_HAVE_ANONYMOUS_STRUCT
 #  undef  CONFIG_HAVE_ANONYMOUS_UNION
 
+/* Indicate that a local variable is not used */
+
+#  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
  * that they are not supported.  Later versions are more ANSII compliant and
@@ -679,10 +675,6 @@
 #  undef  CONFIG_HAVE_DOUBLE
 #  undef  CONFIG_HAVE_LONG_DOUBLE
 
-/* Indicate that a local variable is not used */
-
-#  define UNUSED(a) ((void)(1 || (a)))
-
 #  define offsetof(a, b) ((size_t)(&(((a *)(0))->b)))
 
 #  define no_builtin(n)
@@ -691,14 +683,6 @@
 
 #elif defined(__ICCARM__)
 
-#  define CONFIG_CPP_HAVE_VARARGS 1 /* Supports variable argument macros */
-#  define CONFIG_HAVE_FILENAME 1    /* Has __FILE__ */
-#  define CONFIG_HAVE_FLOAT 1
-
-/* Indicate that a local variable is not used */
-
-#  define UNUSED(a) ((void)(1 || (a)))
-
 #  define weak_alias(name, aliasname)
 #  define weak_data            __weak
 #  define weak_function        __weak
@@ -754,6 +738,14 @@
 #  undef CONFIG_HAVE_ANONYMOUS_STRUCT
 #  undef  CONFIG_HAVE_ANONYMOUS_UNION
 
+/* Indicate that a local variable is not used */
+
+#  define UNUSED(a) ((void)(1 || (a)))
+
+#  define CONFIG_CPP_HAVE_VARARGS 1 /* Supports variable argument macros */
+#  define CONFIG_HAVE_FILENAME 1    /* Has __FILE__ */
+#  define CONFIG_HAVE_FLOAT 1
+
 #  define offsetof(a, b) ((size_t)(&(((a *)(0))->b)))
 
 #  define no_builtin(n)
@@ -767,7 +759,7 @@
 #  undef  CONFIG_HAVE_FUNCTIONNAME
 #  undef  CONFIG_HAVE_FILENAME
 #  undef  CONFIG_HAVE_WEAKFUNCTIONS
-#  undef CONFIG_HAVE_CXX14
+#  undef  CONFIG_HAVE_CXX14
 #  define weak_alias(name, aliasname)
 #  define weak_data
 #  define weak_function