diff options
Diffstat (limited to 'contrib/gcc')
-rw-r--r-- | contrib/gcc/toplev.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/contrib/gcc/toplev.c b/contrib/gcc/toplev.c index 051dcae..4889637 100644 --- a/contrib/gcc/toplev.c +++ b/contrib/gcc/toplev.c @@ -4692,7 +4692,8 @@ check_lang_option (option, lang_option) { lang_independent_options * indep_options; int len; - long k; + int numopts; + long k; char * space; /* Ignore NULL entries. */ @@ -4722,8 +4723,14 @@ check_lang_option (option, lang_option) switch (option[1]) { - case 'f': indep_options = f_options; break; - case 'W': indep_options = W_options; break; + case 'f': + indep_options = f_options; + numopts = NUM_ELEM (f_options); + break; + case 'W': + indep_options = W_options; + numopts = NUM_ELEM (W_options); + break; default: return 1; } @@ -4735,7 +4742,7 @@ check_lang_option (option, lang_option) if (option[0] == 'n' && option[1] == 'o' && option[2] == '-') option += 3; - for (k = NUM_ELEM (indep_options); k--;) + for (k = numopts; k--;) { if (!strcmp (option, indep_options[k].string)) { |