Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 3 Feb 2020 19:08:35 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r357462 - head/contrib/elftoolchain/addr2line
Message-ID:  <202002031908.013J8ZvF049048@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202002031908.013J8ZvF049048>