bfd/elf-properties: avoid shadowing a C library symbol

Message ID 5D10C5DD020000780023A9E6@prv1-mh.provo.novell.com
State New
Headers show
Series
  • bfd/elf-properties: avoid shadowing a C library symbol
Related show

Commit Message

Jan Beulich June 24, 2019, 12:45 p.m.
With my (oldish) gcc/glibc combination I'm seeing

.../bfd/elf-properties.c: In function ‘elf_find_and_remove_property’:
.../bfd/elf-properties.c:244: error: declaration of ‘remove’ shadows a global declaration
/usr/include/stdio.h:157: error: shadowed declaration is here

bfd/
2019-06-24  Jan Beulich  <jbeulich@suse.com>

	* elf-properties.c (elf_find_and_remove_property): Rename last
	parameter. Mention it in comment.

Comments

Alan Modra June 25, 2019, 9:45 a.m. | #1
On Mon, Jun 24, 2019 at 06:45:17AM -0600, Jan Beulich wrote:
> 	* elf-properties.c (elf_find_and_remove_property): Rename last

> 	parameter. Mention it in comment.


Also fine.

-- 
Alan Modra
Australia Development Lab, IBM

Patch

--- master.orig/bfd/elf-properties.c	2019-04-29 08:58:29.129302350 +0200
+++ master/bfd/elf-properties.c	2019-06-24 08:27:06.789969336 +0200
@@ -236,12 +236,12 @@  elf_merge_gnu_properties (struct bfd_lin
   return FALSE;
 }
 
-/* Return the property of TYPE on *LISTP and remove it from *LISTP.
-   Return NULL if not found.  */
+/* Return the property of TYPE on *LISTP and remove it from *LISTP if RM is
+   true.  Return NULL if not found.  */
 
 static elf_property *
 elf_find_and_remove_property (elf_property_list **listp,
-			      unsigned int type, bfd_boolean remove)
+			      unsigned int type, bfd_boolean rm)
 {
   elf_property_list *list;
 
@@ -250,7 +250,7 @@  elf_find_and_remove_property (elf_proper
       if (type == list->property.pr_type)
 	{
 	  /* Remove this property.  */
-	  if (remove)
+	  if (rm)
 	    *listp = list->next;
 	  return &list->property;
 	}