[commit] MIPS: Add ATTRIBUTE_UNUSED to mips_start_function_definition

Message ID 20240111095922.2148110-1-syq@gcc.gnu.org
State Committed
Commit b531bc364d67b56db31d383dab117571875833ca
Headers
Series [commit] MIPS: Add ATTRIBUTE_UNUSED to mips_start_function_definition |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 warning Patch is already merged
linaro-tcwg-bot/tcwg_gcc_build--master-arm warning Patch is already merged

Commit Message

YunQiang Su Jan. 11, 2024, 9:59 a.m. UTC
  Fix build warning:
  mips.cc: warning: unused parameter 'decl'.

gcc
	* config/mips/mips.cc (mips_start_function_definition):
	Add ATTRIBUTE_UNUSED.
---
 gcc/config/mips/mips.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Comments

Bernhard Reutner-Fischer Jan. 15, 2024, 9:05 p.m. UTC | #1
On 11 January 2024 10:59:21 CET, YunQiang Su <syq@gcc.gnu.org> wrote:
>Fix build warning:
>  mips.cc: warning: unused parameter 'decl'.
>
>gcc
>	* config/mips/mips.cc (mips_start_function_definition):
>	Add ATTRIBUTE_UNUSED.
>---
> gcc/config/mips/mips.cc | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
>diff --git a/gcc/config/mips/mips.cc b/gcc/config/mips/mips.cc
>index 60b336e43d0..e752019b5e2 100644
>--- a/gcc/config/mips/mips.cc
>+++ b/gcc/config/mips/mips.cc
>@@ -7330,7 +7330,8 @@ mips_start_unique_function (const char *name)
>    function contains MIPS16 code.  */
> 
> static void
>-mips_start_function_definition (const char *name, bool mips16_p, tree decl)
>+mips_start_function_definition (const char *name, bool mips16_p,
>+				tree decl ATTRIBUTE_UNUSED)

Nowadays in C++ you can just remove the identifier name:

+mips_start_function_definition (const char *name, bool mips16_p, tree)

> {
>   if (mips16_p)
>     fprintf (asm_out_file, "\t.set\tmips16\n");
  

Patch

diff --git a/gcc/config/mips/mips.cc b/gcc/config/mips/mips.cc
index 60b336e43d0..e752019b5e2 100644
--- a/gcc/config/mips/mips.cc
+++ b/gcc/config/mips/mips.cc
@@ -7330,7 +7330,8 @@  mips_start_unique_function (const char *name)
    function contains MIPS16 code.  */
 
 static void
-mips_start_function_definition (const char *name, bool mips16_p, tree decl)
+mips_start_function_definition (const char *name, bool mips16_p,
+				tree decl ATTRIBUTE_UNUSED)
 {
   if (mips16_p)
     fprintf (asm_out_file, "\t.set\tmips16\n");