Re: [PATCH v1 2/2] libtracefs: Fix compiler -Wmemsize-comparison warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 15 Dec 2022 10:31:51 -0800
Ian Rogers <irogers@xxxxxxxxxx> wrote:

> Fixes the following clang warning:
> 
> utest/tracefs-utest.c:828:75: error: size argument in 'strncmp' call is a comparison [-Werror,-Wmemsize-comparison]
>             (!save_debug || strncmp(save_debug, save_tracing, strlen(save_debug) != 0)))
>                                                               ~~~~~~~~~~~~~~~~~~~^~~~
> utest/tracefs-utest.c:828:22: note: did you mean to compare the result of 'strncmp' instead?
>             (!save_debug || strncmp(save_debug, save_tracing, strlen(save_debug) != 0)))
>                             ^                                                        ~
>                                                                                 )
> utest/tracefs-utest.c:828:56: note: explicitly cast the argument to size_t to silence this warning
>             (!save_debug || strncmp(save_debug, save_tracing, strlen(save_debug) != 0)))
>                                                               ^
>                                                               (size_t)(              )

This is why I hate lisp!

Thanks, I'll apply this.

-- Steve



[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux