This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] elf32-nds32: Don't define fls if it is provided by the system
On 2018-09-20 07:38 PM, Alan Modra wrote:
> 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.
>
Thanks, pushed.
Simon