From 96895db3dd648e3506600c423a1c479a2a2b8cf9 Mon Sep 17 00:00:00 2001 From: xia_qirong Date: Mon, 24 May 2021 19:14:44 +0800 Subject: [PATCH] fix about stopping using the deprecated mallinfo function --- ...ing-the-deprecated-mallinfo-function.patch | 59 +++++++++++++++++++ dwarves.spec | 10 +++- 2 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 dtagnames-stop-using-the-deprecated-mallinfo-function.patch diff --git a/dtagnames-stop-using-the-deprecated-mallinfo-function.patch b/dtagnames-stop-using-the-deprecated-mallinfo-function.patch new file mode 100644 index 0000000..40da7b0 --- /dev/null +++ b/dtagnames-stop-using-the-deprecated-mallinfo-function.patch @@ -0,0 +1,59 @@ +From 66d12e4790b7c5e508b75e805589849fee782a49 Mon Sep 17 00:00:00 2001 +From: Arnaldo Carvalho de Melo +Date: Tue, 2 Feb 2021 09:38:46 -0300 +Subject: [PATCH] dtagnames: Stop using the deprecated mallinfo() function +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Bulding on fedora rawhide gets us: + + /home/acme/git/pahole/dtagnames.c:17:16: error: ‘mallinfo’ is deprecated [-Werror=deprecated-declarations] + 17 | struct mallinfo m = mallinfo(); + | ^~~~~~~~ + In file included from /home/acme/git/pahole/dtagnames.c:10: + /usr/include/malloc.h:118:24: note: declared here + 118 | extern struct mallinfo mallinfo (void) __THROW __MALLOC_DEPRECATED; + | ^~~~~~~~ + cc1: all warnings being treated as errors + +glibc-2.32.9000-26.fc34.x86_64 + +So stop using it, was just for debugging/assessing memory usage. + +Signed-off-by: Arnaldo Carvalho de Melo +--- + dtagnames.c | 9 --------- + 1 file changed, 9 deletions(-) + +diff --git a/dtagnames.c b/dtagnames.c +index 0ffcbf7..6a24c37 100644 +--- a/dtagnames.c ++++ b/dtagnames.c +@@ -7,18 +7,10 @@ + + #include + #include +-#include + + #include "dwarves.h" + #include "dutil.h" + +-static void print_malloc_stats(void) +-{ +- struct mallinfo m = mallinfo(); +- +- fprintf(stderr, "size: %u\n", m.uordblks); +-} +- + static int class__tag_name(struct tag *tag, struct cu *cu __unused, + void *cookie __unused) + { +@@ -54,7 +46,6 @@ int main(int argc __unused, char *argv[]) + } + + cus__dump_class_tag_names(cus); +- print_malloc_stats(); + rc = EXIT_SUCCESS; + out: + cus__delete(cus); diff --git a/dwarves.spec b/dwarves.spec index 10f1ded..be2f191 100644 --- a/dwarves.spec +++ b/dwarves.spec @@ -4,7 +4,7 @@ Name: dwarves Version: 1.17 -Release: 1 +Release: 2 License: GPLv2 Summary: Debugging Information Manipulation Tools URL: http://acmel.wordpress.com @@ -16,6 +16,8 @@ BuildRequires: cmake BuildRequires: zlib-devel BuildRequires: elfutils-devel >= 0.170 +Patch6000: dtagnames-stop-using-the-deprecated-mallinfo-function.patch + %description dwarves is a set of tools that use the debugging information inserted in ELF binaries by compilers such as GCC, used by well known debuggers such as @@ -78,6 +80,12 @@ make install DESTDIR=%{buildroot} %{_libdir}/%{libname}_reorganize.so %changelog +* Mon May 24 2021 xiaqirong - 1.17-2 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:bugfix about stopping using the deprecated mallinfo function + * Wed Sep 16 2020 xiaqirong - 1.17-1 - Type:package init - ID:NA -- Gitee