This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH, committed] Re: Adding -Wshadow to binutils builds


Nick Clifton wrote:

>   I tested the patch with the following toolchains: 

>   i686-pc-cygwin

  Alas the testsuite only checks dll functionality when a (cross-)compiler is
available, there are no pure asm tests that would have spotted this problem:

> ld/ChangeLog

> 	* deffilep.y: Fix shadowed variable warnings.

  You missed a few instances, and 18 dll-related testcases started failing.
Fixed thusly, FTR:

ld/ChangeLog:

	* deffilep.y (def_file_free): Add missing shadow parameter renaming.
	(def_file_print): Likewise.
	(def_stash_module): Likewise.
	(def_file_add_import): Likewise.

  Tested native on i686-pc-cygwin and committed.

    cheers,
      DaveK


Index: ld/deffilep.y
===================================================================
RCS file: /cvs/src/src/ld/deffilep.y,v
retrieving revision 1.31
diff -p -u -r1.31 deffilep.y
--- ld/deffilep.y	11 Dec 2009 13:42:14 -0000	1.31
+++ ld/deffilep.y	17 Dec 2009 19:22:47 -0000
@@ -382,7 +382,7 @@ def_file_free (def_file *fdef)
 
   if (fdef->exports)
     {
-      for (i = 0; i < def->num_exports; i++)
+      for (i = 0; i < fdef->num_exports; i++)
 	{
 	  if (fdef->exports[i].internal_name
 	      && fdef->exports[i].internal_name != fdef->exports[i].name)
@@ -512,7 +512,7 @@ def_file_print (FILE *file, def_file *fd
   if (fdef->version_major != -1)
     fprintf (file, "  version: %d.%d\n", fdef->version_major, fdef->version_minor);
 
-  fprintf (file, "<<<< def_file at 0x%08x\n", def);
+  fprintf (file, "<<<< def_file at 0x%08x\n", fdef);
 }
 #endif
 
@@ -569,7 +569,7 @@ def_stash_module (def_file *fdef, const 
   if ((s = def_get_module (fdef, name)) != NULL)
       return s;
   s = xmalloc (sizeof (def_file_module) + strlen (name));
-  s->next = def->modules;
+  s->next = fdef->modules;
   fdef->modules = s;
   s->user_data = 0;
   strcpy (s->name, name);
@@ -602,7 +602,7 @@ def_file_add_import (def_file *fdef,
   if (name)
     i->name = xstrdup (name);
   if (module)
-    i->module = def_stash_module (def, module);
+    i->module = def_stash_module (fdef, module);
   i->ordinal = ordinal;
   if (internal_name)
     i->internal_name = xstrdup (internal_name);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]