trying to understand gcc -- 3 useless (?) lines of code

Axel Freyn axel-freyn@gmx.de
Wed Apr 6 17:26:00 GMT 2011


Hi,

I'm trying to understand gcc-internals a bit more at the moment. Looking
at the main driver, I found three lines in opts-common.c which are
probably useless:

Here's a possible patch against svn:172056 (generate by git)
########################################################################
diff --git a/gcc/opts-common.c b/gcc/opts-common.c
index e314cb3..089d819 100644
--- a/gcc/opts-common.c
+++ b/gcc/opts-common.c
@@ -693,7 +693,6 @@ decode_cmdline_options_to_array (unsigned int argc,
const char **argv,
   unsigned int n, i;
   struct cl_decoded_option *opt_array;
   unsigned int num_decoded_options;
-  bool argv_copied = false;

   opt_array = XNEWVEC (struct cl_decoded_option, argc);

@@ -728,8 +727,6 @@ decode_cmdline_options_to_array (unsigned int argc,
const char **argv,
       num_decoded_options++;
     }

-  if (argv_copied)
-    free (argv);
   *decoded_options = opt_array;
   *decoded_options_count = num_decoded_options;
   prune_options (decoded_options, decoded_options_count);
########################################################################

Those lines were introduced in svn:164531 (22. Sep. 2010), but in
svn:166534 (10. Nov. 2010) the part which could change "argv_copied"
was removed. As no-where in the trunk "argv_copied" appears, it really
seems useless to me at the moment?

Axel

(Is that the best list for such "patcheѕ" -- or would be gcc-patches
more adequate? And I hope the mail contains all necessary informations)



More information about the Gcc-help mailing list