[PATCH] elf32-nds32: Don't define fls if it is provided by the system
Alan Modra
amodra@gmail.com
Thu Sep 20 23:38:00 GMT 2018
On Thu, Sep 20, 2018 at 08:22:59PM +0000, Simon Marchi wrote:
> The fls function already exists on macOS and FreeBSD (and probably others),
> leading to this error:
>
> /Users/simark/src/binutils-gdb/bfd/elf32-nds32.c:5074:1: error: static declaration of 'fls' follows non-static declaration
> fls (register unsigned int x)
> ^
> /usr/include/strings.h:87:6: note: previous declaration is here
> int fls(int) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
> ^
>
> Add a configure-time check for it, and only define it if the system doesn't
> provide it.
>
> bfd/ChangeLog:
>
> * configure.ac: Check for fls.
> * elf32-nds32.c (fls): Only define if !HAVE_FLS.
> * config.in: Re-generate.
> * configure: Re-generate.
OK.
--
Alan Modra
Australia Development Lab, IBM
More information about the Binutils
mailing list