]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix parsing of arguments
authorChristian Groessler <cpg@aladdin.de>
Mon, 18 Dec 2000 14:13:25 +0000 (14:13 +0000)
committerBernd Schmidt <bernds@gcc.gnu.org>
Mon, 18 Dec 2000 14:13:25 +0000 (14:13 +0000)
From-SVN: r38345

gcc/ChangeLog
gcc/toplev.c

index 8243b4d34ed3e05922b0b72b9a17dbe30d4d0501..8b97693598966b4488bd4b42cae08c2ca409793b 100644 (file)
@@ -1,3 +1,8 @@
+2000-12-18  Christian Groessler <cpg@aladdin.de>
+
+       * toplev.c (check_lang_option): Use NUM_ELEM only on arrays, not on
+       pointers.
+
 2000-12-18  Franz Sirl  <Franz.Sirl-kernel@lauterbach.com>
 
        * linux.h (DEFAULT_VTABLE_THUNKS): Switch back to version 1.
index 99e0b719ba34c3011569a0d3deb7526daa6cb89e..242a73cb86089d0a1924869434183e7f8e559181 100644 (file)
@@ -4685,7 +4685,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.  */
@@ -4715,8 +4716,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;
     }
   
@@ -4728,7 +4735,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))
        {