Patchwork proposed patch -- remove superflous lines

login
register
mail settings
Submitter Axel Freyn
Date April 12, 2011, 2:14 p.m.
Message ID <20110412141455.GT3858@axel>
Download mbox | patch
Permalink /patch/90813/
State New
Headers show

Comments

Axel Freyn - April 12, 2011, 2:14 p.m.
Hi,

as that's the first time I propose a patch for gcc: sorry for all formal
mistakes (and please tell me what I should do differently ...)

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, I'm quite
sure those three lines could be removed.

(the diff is generated against svn:172299)




Axel
Joseph S. Myers - April 12, 2011, 4:32 p.m.
On Tue, 12 Apr 2011, Axel Freyn wrote:

> Hi,
> 
> as that's the first time I propose a patch for gcc: sorry for all formal
> mistakes (and please tell me what I should do differently ...)
> 
> 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, I'm quite
> sure those three lines could be removed.

Thanks.  I've committed the patch.  The main thing missing was a ChangeLog 
entry; I used:

2011-04-12  Axel Freyn  <axel-freyn@gmx.de>

	* opts-common.c (decode_cmdline_options_to_array): Remove variable
	argv_copied.

See <http://gcc.gnu.org/contribute.html> for full instructions.  What's 
applicable depends on the individual patch (for example, it doesn't make 
sense to add a testcase for a patch like this that doesn't change the 
compiler's behavior).

Patch

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);