[PATCH] Include <string.h> to dis-asm.h to get strchr declaration

John Baldwin jhb@FreeBSD.org
Tue Jan 15 17:50:00 GMT 2019


On 1/15/19 6:14 AM, Simon Marchi wrote:
> On 2019-01-15 09:01, Nick Clifton wrote:
>> Hi Simon,
>>
>>>> Include <string.h> to dis-asm.h to get strchr declaration
>>
>>>>  #include <stdio.h>
>>>> +#include <string.h>
>>>>  #include "bfd.h"
>>
>>> I took the liberty of pushing this patch which touches code in 
>>> include/, since it seemed obvious enough to me.
>>
>> Do we need to worry about systems that have <strings.h> rather than 
>> <string.h> ?
>>
>> There are various places in the binutils sources (eg binutils/sysdep.h) 
>> which
>> check for configure macros for these headers, which makes me wonder...
> 
>  From what I understand, these systems (BSDs, mostly) have strings.h in 
> addition to string.h, where strings.h provide additional, non-standard 
> functions.  But strchr would still be found in string.h.

Yes, that is true on both FreeBSD and OS X at least (both of which have
<strings.h>).  On those, <strings.h> defines prototypes for things like
bzero() and bcmp().

-- 
John Baldwin

                                                                            



More information about the Binutils mailing list