longind may not be set by getopt_long_only:
diff --git a/ld/lexsup.c b/ld/lexsup.c index 0d10bc6fba..60e3f7d8b5 100644 --- a/ld/lexsup.c +++ b/ld/lexsup.c @@ -735,6 +735,7 @@ parse_args (unsigned argc, char **argv) /* getopt_long_only is like getopt_long, but '-' as well as '--' can indicate a long option. */ opterr = 0; + longind = -1; last_optind = optind; optc = getopt_long_only (argc, argv, shortopts, longopts, &longind); if (optc == '?')
longind may not be set by getopt_long_only:
diff --git a/ld/lexsup.c b/ld/lexsup.c .60e3f7d8b5 100644
index 0d10bc6fba.
--- a/ld/lexsup.c
+++ b/ld/lexsup.c
@@ -735,6 +735,7 @@ parse_args (unsigned argc, char **argv)
/* getopt_long_only is like getopt_long, but '-' as well as '--'
can indicate a long option. */
opterr = 0;
+ longind = -1;
last_optind = optind;
optc = getopt_long_only (argc, argv, shortopts, longopts, &longind);
if (optc == '?')