This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Breakage due to bfd_init change
- From: Alan Modra <amodra at gmail dot com>
- To: Jeff Law <law at redhat dot com>
- Cc: binutils at sourceware dot org
- Date: Tue, 16 Oct 2018 09:06:39 +1030
- Subject: Re: Breakage due to bfd_init change
- References: <544db671-dc08-9165-6956-e3300bb73502@redhat.com>
On Mon, Oct 15, 2018 at 07:56:28AM -0600, Jeff Law wrote:
> In file included from
> /home/law/UPSTREAM/binutils-gdb/sim/cris/../common/cgen-utils.c:21:
> ../../bfd/bfd.h:1083:1: error: unknown type name ‘size_t’
> size_t bfd_init (void);
> ^~~~~~
> ../../bfd/bfd.h:1083:1: note: ‘size_t’ is defined in header
> ‘<stddef.h>’; did you forget to ‘#include <stddef.h>’?
> ../../bfd/bfd.h:104:1:
> +#include <stddef.h>
> #else
> ../../bfd/bfd.h:1083:1:
> size_t bfd_init (void);
> ^~~~~~
I should know better than to introduce the first use of size_t in
bfd.h.
PR 23534
* init.c (bfd_init): Return an unsigned int.
bfd-in2.h: Regenerate.
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index beb695a18b..ee8cd7ef0b 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -1080,7 +1080,7 @@ extern void elf32_csky_next_input_section
extern int elf32_csky_setup_section_lists
(bfd *, struct bfd_link_info *);
/* Extracted from init.c. */
-size_t bfd_init (void);
+unsigned int bfd_init (void);
/* Value returned by bfd_init. */
diff --git a/bfd/init.c b/bfd/init.c
index ad10981931..971d32236a 100644
--- a/bfd/init.c
+++ b/bfd/init.c
@@ -38,7 +38,7 @@ FUNCTION
bfd_init
SYNOPSIS
- size_t bfd_init (void);
+ unsigned int bfd_init (void);
DESCRIPTION
This routine must be called before any other BFD function to
@@ -54,7 +54,7 @@ DESCRIPTION
/* Actually, there is currently nothing for this function to do.
However, someday it may be needed, so keep it around. */
-size_t
+unsigned int
bfd_init (void)
{
return BFD_INIT_MAGIC;
--
Alan Modra
Australia Development Lab, IBM