[LTP] [PATCH v2] change type of variable to fix compile warning

Sun Lianwen sunlw.fnst@cn.fujitsu.com
Fri Jun 15 08:25:19 CEST 2018


Hi Petr,

On 06/15/2018 02:18 PM, Petr Vorel wrote:
> Hi Sun,
> 
>> Change the type of variable from int to unsigned intto fix complie 
>> warning: "comparison between signed and unsigned integer expressions [-Wsign-compare]"
> 
>> Signed-off-by: Sun Lianwen <sunlw.fnst@cn.fujitsu.com>
> 
> You left some of the comparison warnings, can you please fix them?
Thanks your advise, I will fix the left comparison warnings.
> move_pages_support.c: In function ‘alloc_pages_on_nodes’:
> move_pages_support.c:70:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
>   for (i = 0; i < num; i++) {
>                 ^
> move_pages_support.c:74:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
>   for (i = 0; i < num; i++) {
>                 ^
> move_pages_support.c:91:8: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
>   if (i == num)
>         ^~
> symlink01.c: In function ‘get_tcs_info’:
> symlink01.c:601:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
>   for (ctr = 0; ctr < (sizeof(all_tcses) / sizeof(struct tcses)); ctr++) {
>                     ^
> 
> ebizzy.c: In function ‘thread_run’:
> ebizzy.c:424:31: warning: unused parameter ‘arg’ [-Wunused-parameter]
>  static void *thread_run(void *arg)
> This one can be fixed with LTP_ATTRIBUTE_UNUSED
> +#include "tst_common.h"
>                                ^~~
> -static void *thread_run(void *arg)
> +static void *thread_run(void *arg LTP_ATTRIBUTE_UNUSED)
> 
> 
> Kind regards,
> Petr
> 
> 
> .
> 
Thanks
Sun Lianwen




More information about the ltp mailing list