[LTP] [RFC PATCH 2/3] Add more missing <string.h> and <strings.h> includes

阮正旺 ruanzw@xiaopeng.com
Fri Apr 12 11:05:37 CEST 2019


Hi Petr,


-------- Original Message --------
From: Petr Vorel
Sent: Fri, 12 Apr 2019 10:48:53 +0200
To: Cyril Hrubis
Cc: ?????????, Ltp, Petr Vorel, Sandeep Patil, Steve Muckle
Subject: Re: [RFC PATCH 2/3] Add more missing <string.h> and <strings.h> 
includes
> Hi,
>
>>>> diff --git a/include/tst_numa.h b/include/tst_numa.h
>>>> index a4cd1be37..4f9806602 100644
>>>> --- a/include/tst_numa.h
>>>> +++ b/include/tst_numa.h
>>>> @@ -7,6 +7,8 @@
>>>>    #ifndef TST_NUMA_H__
>>>>    #define TST_NUMA_H__
>>>> +#include <string.h>
>>>> +
>>>>    /**
>>>>     * Numa nodemap.
>>>>     */
>>>> diff --git a/lib/tst_af_alg.c b/lib/tst_af_alg.c
>>>> index 97be548b4..edf8c0140 100644
>>>> --- a/lib/tst_af_alg.c
>>>> +++ b/lib/tst_af_alg.c
>>>> @@ -5,6 +5,7 @@
>>>>    #include <errno.h>
>>>>    #include <stdlib.h>
>>>> +#include <string.h>
>>> Why not simply include <string.h>?? in tst_test.h. I did it in my another
>>> review thread. This should be OK for most of cases.
>> Sounds reasonable to me.
> Agree, that'd be the easiest way :). NOTE: not sure what requires that, but
> sometimes is <strings.h> needed as well.

As I know, calls likes str*, mem*, such as, strncpy, memset, requires 
<string.h>,  but bzero requires <strings.h>. Fortunately <strings.h> are 
not used as often as <string.h>. See my another review thread. :-)


Regards,

Zhengwang

>
>
> Kind regards,
> Petr
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20190412/862efbad/attachment.html>


More information about the ltp mailing list