]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
sim: move UNUSED before TYPE in SIM_ENDIAN_INLINE's definition
authorSimon Marchi <simon.marchi@polymtl.ca>
Sun, 20 Jun 2021 02:49:21 +0000 (22:49 -0400)
committerSimon Marchi <simon.marchi@polymtl.ca>
Sun, 20 Jun 2021 02:49:52 +0000 (22:49 -0400)
I get this when building with gcc 11:

      CC       common/common_libcommon_a-sim-load.o
    In file included from /home/simark/src/binutils-gdb/sim/common/sim-n-bits.h:27,
                     from /home/simark/src/binutils-gdb/sim/common/sim-bits.c:259,
                     from /home/simark/src/binutils-gdb/sim/common/sim-bits.h:599,
                     from /home/simark/src/binutils-gdb/sim/common/sim-basics.h:122,
                     from /home/simark/src/binutils-gdb/sim/common/sim-load.c:30:
    /home/simark/src/binutils-gdb/sim/common/sim-n-endian.h:39:27: error: 'offset_16' defined but not used [-Werror=unused-function]
       39 | #define offset_N XCONCAT2(offset_,N)
          |                           ^~~~~~~
    /home/simark/src/binutils-gdb/sim/../include/symcat.h:23:26: note: in definition of macro 'CONCAT2'
       23 | #define CONCAT2(a,b)     a##b
          |                          ^
    /home/simark/src/binutils-gdb/sim/common/sim-n-endian.h:39:18: note: in expansion of macro 'XCONCAT2'
       39 | #define offset_N XCONCAT2(offset_,N)
          |                  ^~~~~~~~
    /home/simark/src/binutils-gdb/sim/common/sim-n-endian.h:138:1: note: in expansion of macro 'offset_N'
      138 | offset_N (unsigned_N *x,
          | ^~~~~~~~

offset_N uses INLINE_SIM_ENDIAN, which uses UNUSED to put the "unused"
attribute.  However, it appears after the function's return type, which
seems to make it not apply to the function.  Moving it to before the
return type fixes the error.

Change all instances found in that file.

sim/common/ChangeLog:

* sim-inline.h: Move UNUSED before TYPE.

Change-Id: Ide20106683ed7a9ebf35d484dabf70b309cb1ba6

sim/common/ChangeLog
sim/common/sim-inline.h

index 455fe492d7706e958d61f0ec1664b18264fa6ea4..cda7b953540c3085c06b4a084ed345ec37080f86 100644 (file)
@@ -1,3 +1,7 @@
+2021-06-19  Simon Marchi  <simon.marchi@polymtl.ca>
+
+       * sim-inline.h: Move UNUSED before TYPE.
+
 2021-06-19  Mike Frysinger  <vapier@gentoo.org>
 
        * Make-common.in (clean): Delete BUILT_SRC_FROM_COMMON usage.
index 2750fa93cbc731d4b1c1e1f7ad1dac6b8680f4ac..a397e58e10f2d450fbc5892d5fd81561eabbb5a6 100644 (file)
      && !defined (SIM_ARANGE_C) \
      && (REVEAL_MODULE_P (SIM_ARANGE_INLINE)))
 # if (SIM_ARANGE_INLINE & INLINE_GLOBALS)
-#  define INLINE_SIM_ARANGE(TYPE) static INLINE TYPE UNUSED
+#  define INLINE_SIM_ARANGE(TYPE) static INLINE UNUSED TYPE
 #  define EXTERN_SIM_ARANGE_P 0
 # else
-#  define INLINE_SIM_ARANGE(TYPE) static TYPE UNUSED
+#  define INLINE_SIM_ARANGE(TYPE) static UNUSED TYPE
 #  define EXTERN_SIM_ARANGE_P 0
 # endif
 #else
      && !defined (SIM_BITS_C) \
      && (REVEAL_MODULE_P (SIM_BITS_INLINE)))
 # if (SIM_BITS_INLINE & INLINE_GLOBALS)
-#  define INLINE_SIM_BITS(TYPE) static INLINE TYPE UNUSED
+#  define INLINE_SIM_BITS(TYPE) static INLINE UNUSED TYPE
 #  define EXTERN_SIM_BITS_P 0
 # else
-#  define INLINE_SIM_BITS(TYPE) static TYPE UNUSED
+#  define INLINE_SIM_BITS(TYPE) static UNUSED TYPE
 #  define EXTERN_SIM_BITS_P 0
 # endif
 #else
      && !defined (SIM_CORE_C) \
      && (REVEAL_MODULE_P (SIM_CORE_INLINE)))
 # if (SIM_CORE_INLINE & INLINE_GLOBALS)
-#  define INLINE_SIM_CORE(TYPE) static INLINE TYPE UNUSED
+#  define INLINE_SIM_CORE(TYPE) static INLINE UNUSED TYPE
 #  define EXTERN_SIM_CORE_P 0
 #else
-#  define INLINE_SIM_CORE(TYPE) static TYPE UNUSED
+#  define INLINE_SIM_CORE(TYPE) static UNUSED TYPE
 #  define EXTERN_SIM_CORE_P 0
 #endif
 #else
      && !defined (SIM_ENDIAN_C) \
      && (REVEAL_MODULE_P (SIM_ENDIAN_INLINE)))
 # if (SIM_ENDIAN_INLINE & INLINE_GLOBALS)
-#  define INLINE_SIM_ENDIAN(TYPE) static INLINE TYPE UNUSED
+#  define INLINE_SIM_ENDIAN(TYPE) static INLINE UNUSED TYPE
 #  define EXTERN_SIM_ENDIAN_P 0
 # else
-#  define INLINE_SIM_ENDIAN(TYPE) static TYPE UNUSED
+#  define INLINE_SIM_ENDIAN(TYPE) static UNUSED TYPE
 #  define EXTERN_SIM_ENDIAN_P 0
 # endif
 #else
      && !defined (SIM_EVENTS_C) \
      && (REVEAL_MODULE_P (SIM_EVENTS_INLINE)))
 # if (SIM_EVENTS_INLINE & INLINE_GLOBALS)
-#  define INLINE_SIM_EVENTS(TYPE) static INLINE TYPE UNUSED
+#  define INLINE_SIM_EVENTS(TYPE) static INLINE UNUSED TYPE
 #  define EXTERN_SIM_EVENTS_P 0
 # else
-#  define INLINE_SIM_EVENTS(TYPE) static TYPE UNUSED
+#  define INLINE_SIM_EVENTS(TYPE) static UNUSED TYPE
 #  define EXTERN_SIM_EVENTS_P 0
 # endif
 #else
      && !defined (SIM_FPU_C) \
      && (REVEAL_MODULE_P (SIM_FPU_INLINE)))
 # if (SIM_FPU_INLINE & INLINE_GLOBALS)
-#  define INLINE_SIM_FPU(TYPE) static INLINE TYPE UNUSED
+#  define INLINE_SIM_FPU(TYPE) static INLINE UNUSED TYPE
 #  define EXTERN_SIM_FPU_P 0
 # else
-#  define INLINE_SIM_FPU(TYPE) static TYPE UNUSED
+#  define INLINE_SIM_FPU(TYPE) static UNUSED TYPE
 #  define EXTERN_SIM_FPU_P 0
 # endif
 #else
      && !defined (SIM_TYPES_C) \
      && (REVEAL_MODULE_P (SIM_TYPES_INLINE)))
 # if (SIM_TYPES_INLINE & INLINE_GLOBALS)
-#  define INLINE_SIM_TYPES(TYPE) static INLINE TYPE UNUSED
+#  define INLINE_SIM_TYPES(TYPE) static INLINE UNUSED TYPE
 #  define EXTERN_SIM_TYPES_P 0
 # else
-#  define INLINE_SIM_TYPES(TYPE) static TYPE UNUSED
+#  define INLINE_SIM_TYPES(TYPE) static UNUSED TYPE
 #  define EXTERN_SIM_TYPES_P 0
 # endif
 #else
      && !defined (SIM_MAIN_C) \
      && (REVEAL_MODULE_P (SIM_MAIN_INLINE)))
 # if (SIM_MAIN_INLINE & INLINE_GLOBALS)
-#  define INLINE_SIM_MAIN(TYPE) static INLINE TYPE UNUSED
+#  define INLINE_SIM_MAIN(TYPE) static INLINE UNUSED TYPE
 #  define EXTERN_SIM_MAIN_P 0
 # else
-#  define INLINE_SIM_MAIN(TYPE) static TYPE UNUSED
+#  define INLINE_SIM_MAIN(TYPE) static UNUSED TYPE
 #  define EXTERN_SIM_MAIN_P 0
 # endif
 #else
      && !defined (ENGINE_C) \
      && (REVEAL_MODULE_P (ENGINE_INLINE)))
 # if (ENGINE_INLINE & INLINE_GLOBALS)
-#  define INLINE_ENGINE(TYPE) static INLINE TYPE UNUSED
+#  define INLINE_ENGINE(TYPE) static INLINE UNUSED TYPE
 #  define EXTERN_ENGINE_P 0
 # else
-#  define INLINE_ENGINE(TYPE) static TYPE UNUSED
+#  define INLINE_ENGINE(TYPE) static UNUSED TYPE
 #  define EXTERN_ENGINE_P 0
 # endif
 #else
      && !defined (ICACHE_C) \
      && (REVEAL_MODULE_P (ICACHE_INLINE)))
 # if (ICACHE_INLINE & INLINE_GLOBALS)
-#  define INLINE_ICACHE(TYPE) static INLINE TYPE UNUSED
+#  define INLINE_ICACHE(TYPE) static INLINE UNUSED TYPE
 #  define EXTERN_ICACHE_P 0
 #else
-#  define INLINE_ICACHE(TYPE) static TYPE UNUSED
+#  define INLINE_ICACHE(TYPE) static UNUSED TYPE
 #  define EXTERN_ICACHE_P 0
 #endif
 #else
      && !defined (IDECODE_C) \
      && (REVEAL_MODULE_P (IDECODE_INLINE)))
 # if (IDECODE_INLINE & INLINE_GLOBALS)
-#  define INLINE_IDECODE(TYPE) static INLINE TYPE UNUSED
+#  define INLINE_IDECODE(TYPE) static INLINE UNUSED TYPE
 #  define EXTERN_IDECODE_P 0
 #else
-#  define INLINE_IDECODE(TYPE) static TYPE UNUSED
+#  define INLINE_IDECODE(TYPE) static UNUSED TYPE
 #  define EXTERN_IDECODE_P 0
 #endif
 #else
      && !defined (SEMANTICS_C) \
      && (REVEAL_MODULE_P (SEMANTICS_INLINE)))
 # if (SEMANTICS_INLINE & INLINE_GLOBALS)
-#  define INLINE_SEMANTICS(TYPE) static INLINE TYPE UNUSED
+#  define INLINE_SEMANTICS(TYPE) static INLINE UNUSED TYPE
 #  define EXTERN_SEMANTICS_P 0
 #else
-#  define INLINE_SEMANTICS(TYPE) static TYPE UNUSED
+#  define INLINE_SEMANTICS(TYPE) static UNUSED TYPE
 #  define EXTERN_SEMANTICS_P 0
 #endif
 #else
 #if EXTERN_SEMANTICS_P
 # define EXTERN_SEMANTICS(TYPE) TYPE
 #else
-# define EXTERN_SEMANTICS(TYPE) static TYPE UNUSED
+# define EXTERN_SEMANTICS(TYPE) static UNUSED TYPE
 #endif
 
 #if (SEMANTICS_INLINE & INLINE_LOCALS)
      && !defined (SUPPORT_C) \
      && (REVEAL_MODULE_P (SUPPORT_INLINE)))
 # if (SUPPORT_INLINE & INLINE_GLOBALS)
-#  define INLINE_SUPPORT(TYPE) static INLINE TYPE UNUSED
+#  define INLINE_SUPPORT(TYPE) static INLINE UNUSED TYPE
 #  define EXTERN_SUPPORT_P 0
 #else
-#  define INLINE_SUPPORT(TYPE) static TYPE UNUSED
+#  define INLINE_SUPPORT(TYPE) static UNUSED TYPE
 #  define EXTERN_SUPPORT_P 0
 #endif
 #else