pkgsrc/devel/elftoolchain/patches/patch-ai
agc f15d9e1fe6 Initial import of elftoolchain-0.5.1 into the packages collection.
A BSD-licensed implementation of compilation tools (nm, ar,
	as, ld, etc.) for the ELF object format.

	This release contains BSD-licensed implementations of the
	"libdwarf" and "libelf" libraries, and of the "addr2line",
	"ar", "brandelf", "c++filt", "elfcopy", "elfdump",
	"findtextrel", "mcs", "nm", "ranlib", "readelf", "size",
	"strings" and "strip" program development utilities.  The
	release also contains API and utility reference documentation
	(300+ manual entries in all), and contains test suites for
	some of these released utilities and libraries.

With thanks to jkoshy for all the help.
2011-11-20 06:25:17 +00:00

36 lines
1 KiB
Text

$NetBSD: patch-ai,v 1.1.1.1 2011/11/20 06:25:18 agc Exp $
Fix warning for printf format messages with gcc 4.5 and -Wformat=2
--- nm/nm.c 2011/11/18 21:31:02 1.1
+++ nm/nm.c 2011/11/18 21:45:38
@@ -855,9 +855,9 @@
if (nm_opts.demangle_type < 0 ||
elftc_demangle(name, dem, sizeof(dem), nm_opts.demangle_type) < 0)
- printf(format, name);
+ printf((strcmp(format, "%s") == 0) ? "%s" : "%-20s|", name);
else
- printf(format, dem);
+ printf((strcmp(format, "%s") == 0) ? "%s" : "%-20s|", dem);
}
static void
@@ -1355,7 +1355,7 @@
process_sym:
p_data.list_num = get_sym(elf, &list_head, shnum, dynndx, strndx,
- type_table, (const char **)sec_table, shnum);
+ type_table, (const char **)(const void **)sec_table, shnum);
if (p_data.list_num == 0)
goto next_cmd;
@@ -1363,7 +1363,7 @@
p_data.headp = &list_head;
p_data.sh_num = shnum;
p_data.t_table = type_table;
- p_data.s_table = (const char **)sec_table;
+ p_data.s_table = (const char **)(const void **)sec_table;
p_data.filename = filename;
p_data.objname = objname;