[binutils-gdb/binutils-2_45-branch] Fix compile time warning message about optarg parameter shadowing global variable

Nick Clifton nickc@sourceware.org
Sun Jul 13 10:35:34 GMT 2025


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=cfa55064f44357df5ff09792d6aba2e598583bbe

commit cfa55064f44357df5ff09792d6aba2e598583bbe
Author: Nick Clifton <nickc@redhat.com>
Date:   Sun Jul 13 11:35:28 2025 +0100

    Fix compile time warning message about optarg parameter shadowing global variable

Diff:
---
 ld/emultempl/aarch64elf.em | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/ld/emultempl/aarch64elf.em b/ld/emultempl/aarch64elf.em
index 66eaf1cd861..91d58d8fe5a 100644
--- a/ld/emultempl/aarch64elf.em
+++ b/ld/emultempl/aarch64elf.em
@@ -448,22 +448,22 @@ aarch64_parse_gcs_option (const char *_optarg)
 }
 
 static bool
-aarch64_parse_memtag_mode_option (const char *optarg)
+aarch64_parse_memtag_mode_option (const char *_optarg)
 {
   #define MEMTAG_MODE      "memtag-mode"
   #define MEMTAG_MODE_LEN  COMPILE_TIME_STRLEN (MEMTAG_MODE)
 
-  if (strncmp (optarg, MEMTAG_MODE, MEMTAG_MODE_LEN) != 0)
+  if (strncmp (_optarg, MEMTAG_MODE, MEMTAG_MODE_LEN) != 0)
     return false;
 
-  if (strcmp (optarg + MEMTAG_MODE_LEN, "=none") == 0)
+  if (strcmp (_optarg + MEMTAG_MODE_LEN, "=none") == 0)
     memtag_opts.memtag_mode = AARCH64_MEMTAG_MODE_NONE;
-  else if (strcmp (optarg + MEMTAG_MODE_LEN, "=sync") == 0)
+  else if (strcmp (_optarg + MEMTAG_MODE_LEN, "=sync") == 0)
     memtag_opts.memtag_mode = AARCH64_MEMTAG_MODE_SYNC;
-  else if (strcmp (optarg + MEMTAG_MODE_LEN, "=async") == 0)
+  else if (strcmp (_optarg + MEMTAG_MODE_LEN, "=async") == 0)
     memtag_opts.memtag_mode = AARCH64_MEMTAG_MODE_ASYNC;
   else
-    einfo (_("%X%P: error: unrecognized value '-z %s'\n"), optarg);
+    einfo (_("%X%P: error: unrecognized value '-z %s'\n"), _optarg);
 
   return true;


More information about the Binutils-cvs mailing list