On Sun, Aug 09, 2020 at 11:24:19PM +0200, Michal Kubecek wrote:
> Get rid of compiler warnings about comparison between signed and
> unsigned integer values in netlink code.
> 
> Signed-off-by: Michal Kubecek <[email protected]>
> ---
>  netlink/features.c | 4 ++--
>  netlink/netlink.c  | 4 ++--
>  netlink/netlink.h  | 2 +-
>  netlink/nlsock.c   | 2 +-
>  netlink/parser.c   | 2 +-
>  netlink/settings.c | 6 +++---
>  6 files changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/netlink/features.c b/netlink/features.c
> index 8b5b8588ca23..f5862e97a265 100644
> --- a/netlink/features.c
> +++ b/netlink/features.c
> @@ -149,7 +149,7 @@ int dump_features(const struct nlattr *const *tb,
>                       continue;
>  
>               for (j = 0; j < results.count; j++) {
> -                     if (feature_flags[j] == i) {
> +                     if (feature_flags[j] == (int)i) {
>                               n_match++;
>                               flag_value = flag_value ||
>                                       feature_on(results.active, j);
> @@ -163,7 +163,7 @@ int dump_features(const struct nlattr *const *tb,
>               for (j = 0; j < results.count; j++) {
>                       const char *name = get_string(feature_names, j);
>  
> -                     if (feature_flags[j] != i)
> +                     if (feature_flags[j] != (int)i)

Hi Michal

Would it be better to make feature_flags an unsigned int * ? And
change the -1 to MAX_UNIT?

       Andrew

Reply via email to