Author: markj
Date: Mon Feb  3 19:08:35 2020
New Revision: 357462
URL: https://svnweb.freebsd.org/changeset/base/357462

Log:
  addr2line: Avoid a name collision.
  
  The RB_ macros define functions with a parameter named head, and gcc
  warns about this.
  
  MFC with:     r357450

Modified:
  head/contrib/elftoolchain/addr2line/addr2line.c

Modified: head/contrib/elftoolchain/addr2line/addr2line.c
==============================================================================
--- head/contrib/elftoolchain/addr2line/addr2line.c     Mon Feb  3 18:59:07 
2020        (r357461)
+++ head/contrib/elftoolchain/addr2line/addr2line.c     Mon Feb  3 19:08:35 
2020        (r357462)
@@ -87,7 +87,7 @@ static char unknown[] = { '?', '?', '\0' };
 static Dwarf_Addr section_base;
 /* Need a new curlopc that stores last lopc value. */
 static Dwarf_Unsigned curlopc = ~0ULL;
-static RB_HEAD(cutree, CU) head = RB_INITIALIZER(&head);
+static RB_HEAD(cutree, CU) cuhead = RB_INITIALIZER(&cuhead);
 
 static int
 lopccmp(struct CU *e1, struct CU *e2)
@@ -397,14 +397,14 @@ culookup(Dwarf_Unsigned addr)
        struct CU find, *res;
 
        find.lopc = addr;
-       res = RB_NFIND(cutree, &head, &find);
+       res = RB_NFIND(cutree, &cuhead, &find);
        if (res != NULL) {
                if (res->lopc != addr)
-                       res = RB_PREV(cutree, &head, res);
+                       res = RB_PREV(cutree, &cuhead, res);
                if (res != NULL && addr >= res->lopc && addr < res->hipc)
                        return (res);
        } else {
-               res = RB_MAX(cutree, &head);
+               res = RB_MAX(cutree, &cuhead);
                if (res != NULL && addr >= res->lopc && addr < res->hipc)
                        return (res);
        }
@@ -509,7 +509,7 @@ translate(Dwarf_Debug dbg, Elf *e, const char* addrstr
                                cu->hipc = hipc;
                                cu->die = die;
                                STAILQ_INIT(&cu->funclist);
-                               RB_INSERT(cutree, &head, cu);
+                               RB_INSERT(cutree, &cuhead, cu);
 
                                curlopc = lopc;
                                break;
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to