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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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)



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux