From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1062) id 2980D385354C; Fri, 28 Apr 2023 06:16:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2980D385354C 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] Remove deprecated bfd_read X-Act-Checkin: binutils-gdb X-Git-Author: Alan Modra X-Git-Refname: refs/heads/master X-Git-Oldrev: 6b258591644cf1db97113cc00f5373135d8755ba X-Git-Newrev: 4cb2aab8ab9e18d9dfdd8fa362715d70cc2d1109 Message-Id: <20230428061625.2980D385354C@sourceware.org> Date: Fri, 28 Apr 2023 06:16:25 +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: Fri, 28 Apr 2023 06:16:25 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D4cb2aab8ab9e= 18d9dfdd8fa362715d70cc2d1109 commit 4cb2aab8ab9e18d9dfdd8fa362715d70cc2d1109 Author: Alan Modra Date: Thu Apr 27 08:26:50 2023 +0930 Remove deprecated bfd_read =20 20+ years is long enough to warn. =20 * bfd-in.h (bfd_read, bfd_write): Don't define (_bfd_warn_deprecated): Don't declare. * bfd-in2.h: Regenerate. * libbfd.c (_bfd_warn_deprecated): Delete. Diff: --- bfd/bfd-in.h | 18 ------------------ bfd/bfd-in2.h | 18 ------------------ bfd/libbfd.c | 28 ---------------------------- 3 files changed, 64 deletions(-) diff --git a/bfd/bfd-in.h b/bfd/bfd-in.h index eb6ee9cf816..de7285626cd 100644 --- a/bfd/bfd-in.h +++ b/bfd/bfd-in.h @@ -362,24 +362,6 @@ extern file_ptr bfd_tell (bfd *); extern int bfd_flush (bfd *); extern int bfd_stat (bfd *, struct stat *); =20 -/* Deprecated old routines. */ -#if __GNUC__ -#define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ - (_bfd_warn_deprecated ("bfd_read", __FILE__, __LINE__, __func__), \ - bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) -#define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ - (_bfd_warn_deprecated ("bfd_write", __FILE__, __LINE__, __func__), \ - bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) -#else -#define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ - (_bfd_warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0= ), \ - bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) -#define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ - (_bfd_warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) = 0),\ - bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) -#endif -extern void _bfd_warn_deprecated (const char *, const char *, int, const c= har *); - extern bool bfd_cache_close (bfd *abfd); /* NB: This declaration should match the autogenerated one in libbfd.h. */ diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h index fcfd22662f3..1eae010d9ca 100644 --- a/bfd/bfd-in2.h +++ b/bfd/bfd-in2.h @@ -369,24 +369,6 @@ extern file_ptr bfd_tell (bfd *); extern int bfd_flush (bfd *); extern int bfd_stat (bfd *, struct stat *); =20 -/* Deprecated old routines. */ -#if __GNUC__ -#define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ - (_bfd_warn_deprecated ("bfd_read", __FILE__, __LINE__, __func__), \ - bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) -#define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ - (_bfd_warn_deprecated ("bfd_write", __FILE__, __LINE__, __func__), \ - bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) -#else -#define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) \ - (_bfd_warn_deprecated ("bfd_read", (const char *) 0, 0, (const char *) 0= ), \ - bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) -#define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) \ - (_bfd_warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) = 0),\ - bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) -#endif -extern void _bfd_warn_deprecated (const char *, const char *, int, const c= har *); - extern bool bfd_cache_close (bfd *abfd); /* NB: This declaration should match the autogenerated one in libbfd.h. */ diff --git a/bfd/libbfd.c b/bfd/libbfd.c index 7b03bde05e0..d4f1478ec07 100644 --- a/bfd/libbfd.c +++ b/bfd/libbfd.c @@ -1074,34 +1074,6 @@ bfd_generic_is_local_label_name (bfd *abfd, const ch= ar *name) return name[0] =3D=3D locals_prefix; } =20 -/* Give a warning at runtime if someone compiles code which calls - old routines. */ - -void -_bfd_warn_deprecated (const char *what, - const char *file, - int line, - const char *func) -{ - /* Poor man's tracking of functions we've already warned about. */ - static size_t mask =3D 0; - - if (~(size_t) func & ~mask) - { - fflush (stdout); - /* Note: separate sentences in order to allow - for translation into other languages. */ - if (func) - /* xgettext:c-format */ - fprintf (stderr, _("Deprecated %s called at %s line %d in %s\n"), - what, file, line, func); - else - fprintf (stderr, _("Deprecated %s called\n"), what); - fflush (stderr); - mask |=3D ~(size_t) func; - } -} - /* Helper function for reading uleb128 encoded data. */ =20 bfd_vma