[PATCH v2 2/2] Port strnstr.c to newlib.

Sichen Zhao 1473996754@qq.com
Fri Aug 25 07:36:00 GMT 2017


> On 25/08/17 08:15, Sichen Zhao wrote:
>
>> ---
>>   newlib/libc/include/string.h   |  3 +++
>>   newlib/libc/string/Makefile.am |  1 +
>>   newlib/libc/string/strnstr.c   | 13 ++++++-------
>>   3 files changed, 10 insertions(+), 7 deletions(-)
>>
>> diff --git a/newlib/libc/include/string.h b/newlib/libc/include/string.h
>> index 7833aa1..304d8a5 100644
>> --- a/newlib/libc/include/string.h
>> +++ b/newlib/libc/include/string.h
>> @@ -121,6 +121,9 @@ size_t     _EXFUN(strnlen,(const char *, size_t));
>>   #if __BSD_VISIBLE
>>   char     *_EXFUN(strsep,(char **, const char *));
>>   #endif
>> +#if __BSD_VISIBLE
>> +char     *_EXFUN(strnstr,(const char *, const char *, size_t));
>> +#endif
>
> I would rather use the FreeBSD prototype:
>
> #if __BSD_VISIBLE
> char    *strnstr(const char *, const char *, size_t) __pure;
> #endif
>
> This makes the strnstr.c modifications unnecessary. I think the 
> _EXFUN() stuff is deprecated.
>
Ok, i see.



More information about the Newlib mailing list