From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1062) id A47153858428; Tue, 1 Aug 2023 22:29:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A47153858428 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Alan Modra To: bfd-cvs@sourceware.org Subject: [binutils-gdb] Don't declare xmalloc or xrealloc in bucomm.h X-Act-Checkin: binutils-gdb X-Git-Author: Alan Modra X-Git-Refname: refs/heads/master X-Git-Oldrev: 665b41c0ce13ab2f9df18881a699c5e896e906f2 X-Git-Newrev: b6456e91d40fd38db264db26991c99381a3da5e6 Message-Id: <20230801222941.A47153858428@sourceware.org> Date: Tue, 1 Aug 2023 22:29:41 +0000 (GMT) X-BeenThere: binutils-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Aug 2023 22:29:41 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Db6456e91d40f= d38db264db26991c99381a3da5e6 commit b6456e91d40fd38db264db26991c99381a3da5e6 Author: Alan Modra Date: Wed Aug 2 07:53:26 2023 +0930 Don't declare xmalloc or xrealloc in bucomm.h =20 It's better to include the proper header, which has declarations with various attributes. Commit 096aefc040 in 1994 introduced this wart. =20 * bucomm.h (xmalloc, xrealloc): Delete declaration. * od-macho.c: Include libiberty.h. * od-xcoff.c: Include libiberty.h. Diff: --- 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 0c11c0b868d..b70879078ee 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); =20 - -/* In libiberty. */ -void *xmalloc (size_t); - -void *xrealloc (void *, size_t); - #if __GNUC__ >=3D 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 17253d4f70b..c2bd7d38a89 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 92d17e99fbf..e6b2f08c245 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"