From b6456e91d40fd38db264db26991c99381a3da5e6 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Wed, 2 Aug 2023 07:53:26 +0930 Subject: Don't declare xmalloc or xrealloc in bucomm.h It's better to include the proper header, which has declarations with various attributes. Commit 096aefc040 in 1994 introduced this wart. * bucomm.h (xmalloc, xrealloc): Delete declaration. * od-macho.c: Include libiberty.h. * od-xcoff.c: Include libiberty.h. --- binutils/bucomm.h | 6 ------ binutils/od-macho.c | 1 + binutils/od-xcoff.c | 1 + 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/binutils/bucomm.h b/binutils/bucomm.h index 0c11c0b..b708790 100644 --- a/binutils/bucomm.h +++ b/binutils/bucomm.h @@ -76,12 +76,6 @@ extern void set_times (const char *, const struct stat *); extern int smart_rename (const char *, const char *, int, struct stat *, bool); - -/* In libiberty. */ -void *xmalloc (size_t); - -void *xrealloc (void *, size_t); - #if __GNUC__ >= 7 #define _mul_overflow(a, b, res) __builtin_mul_overflow (a, b, res) #else diff --git a/binutils/od-macho.c b/binutils/od-macho.c index 17253d4..c2bd7d3 100644 --- a/binutils/od-macho.c +++ b/binutils/od-macho.c @@ -23,6 +23,7 @@ #include #include #include "safe-ctype.h" +#include "libiberty.h" #include "bfd.h" #include "objdump.h" #include "bucomm.h" diff --git a/binutils/od-xcoff.c b/binutils/od-xcoff.c index 92d17e9..e6b2f08 100644 --- a/binutils/od-xcoff.c +++ b/binutils/od-xcoff.c @@ -23,6 +23,7 @@ #include #include #include "safe-ctype.h" +#include "libiberty.h" #include "bfd.h" #include "objdump.h" #include "bucomm.h" -- cgit v1.1