diff options
author | Nick Clifton <nickc@redhat.com> | 2024-12-05 09:58:06 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2024-12-05 09:58:06 +0000 |
commit | a042adc98554870ba21e3cda5211a28fad98c217 (patch) | |
tree | 44bcd23861a2c1a780b0f18b1322973e8efd84e6 /ld | |
parent | 38b2f5b99b0e6b7e06d27d7c168af53e0c0d5c79 (diff) | |
download | binutils-a042adc98554870ba21e3cda5211a28fad98c217.zip binutils-a042adc98554870ba21e3cda5211a28fad98c217.tar.gz binutils-a042adc98554870ba21e3cda5211a28fad98c217.tar.bz2 |
Fix clang compile time warning about optarg parameter shadowing optarg global variable.
Diffstat (limited to 'ld')
-rw-r--r-- | ld/emultempl/aarch64elf.em | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/ld/emultempl/aarch64elf.em b/ld/emultempl/aarch64elf.em index 6dcb296..b4c9016 100644 --- a/ld/emultempl/aarch64elf.em +++ b/ld/emultempl/aarch64elf.em @@ -354,34 +354,34 @@ aarch64_elf_create_output_section_statements (void) } static bool -aarch64_parse_feature_report_option (const char *optarg, +aarch64_parse_feature_report_option (const char *_optarg, const char *report_opt, const size_t report_opt_len, aarch64_feature_marking_report *level) { - if (strncmp (optarg, report_opt, report_opt_len) != 0) + if (strncmp (_optarg, report_opt, report_opt_len) != 0) return false; - if (strlen (optarg) == report_opt_len - || strcmp (optarg + report_opt_len, "=warning") == 0) + if (strlen (_optarg) == report_opt_len + || strcmp (_optarg + report_opt_len, "=warning") == 0) *level = MARKING_WARN; - else if (strcmp (optarg + report_opt_len, "=none") == 0) + else if (strcmp (_optarg + report_opt_len, "=none") == 0) *level = MARKING_NONE; - else if (strcmp (optarg + report_opt_len, "=error") == 0) + else if (strcmp (_optarg + report_opt_len, "=error") == 0) *level = MARKING_ERROR; else - einfo (_("%X%P: error: unrecognized value '-z %s'\n"), optarg); + einfo (_("%X%P: error: unrecognized value '-z %s'\n"), _optarg); return true; } static bool -aarch64_parse_bti_report_option (const char *optarg) +aarch64_parse_bti_report_option (const char *_optarg) { #define BTI_REPORT "bti-report" #define BTI_REPORT_LEN COMPILE_TIME_STRLEN (BTI_REPORT) - return aarch64_parse_feature_report_option (optarg, BTI_REPORT, + return aarch64_parse_feature_report_option (_optarg, BTI_REPORT, BTI_REPORT_LEN, &sw_protections.bti_report); #undef BTI_REPORT @@ -389,12 +389,12 @@ aarch64_parse_bti_report_option (const char *optarg) } static bool -aarch64_parse_gcs_report_option (const char *optarg) +aarch64_parse_gcs_report_option (const char *_optarg) { #define GCS_REPORT "gcs-report" #define GCS_REPORT_LEN COMPILE_TIME_STRLEN (GCS_REPORT) - return aarch64_parse_feature_report_option (optarg, GCS_REPORT, + return aarch64_parse_feature_report_option (_optarg, GCS_REPORT, GCS_REPORT_LEN, &sw_protections.gcs_report); #undef GCS_REPORT @@ -402,22 +402,22 @@ aarch64_parse_gcs_report_option (const char *optarg) } static bool -aarch64_parse_gcs_option (const char *optarg) +aarch64_parse_gcs_option (const char *_optarg) { #define GCS "gcs" #define GCS_LEN COMPILE_TIME_STRLEN (GCS) - if (strncmp (optarg, GCS, GCS_LEN) != 0) + if (strncmp (_optarg, GCS, GCS_LEN) != 0) return false; - if (strcmp (optarg + GCS_LEN, "=always") == 0) + if (strcmp (_optarg + GCS_LEN, "=always") == 0) sw_protections.gcs_type = GCS_ALWAYS; - else if (strcmp (optarg + GCS_LEN, "=never") == 0) + else if (strcmp (_optarg + GCS_LEN, "=never") == 0) sw_protections.gcs_type = GCS_NEVER; - else if (strcmp (optarg + GCS_LEN, "=implicit") == 0) + else if (strcmp (_optarg + GCS_LEN, "=implicit") == 0) sw_protections.gcs_type = GCS_IMPLICIT; else - einfo (_("%X%P: error: unrecognized value '-z %s'\n"), optarg); + einfo (_("%X%P: error: unrecognized value '-z %s'\n"), _optarg); return true; |