Bug 22489 - gcc warns about implicit convertion in ICMP6_FILTER_SETPASS with -Wsign-conversion
Summary: gcc warns about implicit convertion in ICMP6_FILTER_SETPASS with -Wsign-conve...
Status: RESOLVED FIXED
Alias: None
Product: glibc
Classification: Unclassified
Component: network (show other bugs)
Version: 2.26
: P2 minor
Target Milestone: 2.32
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-11-24 20:22 UTC by Sergey
Modified: 2020-07-08 16:43 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
fweimer: security-


Attachments
A patch to fix (373 bytes, patch)
2017-11-24 20:22 UTC, Sergey
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey 2017-11-24 20:22:37 UTC
Created attachment 10633 [details]
A patch to fix

The simplest code (icmp6_test.c)

#include <stdlib.h>                                                           
#include <netinet/icmp6.h>                                                    
                                                                              
int main()                                                                    
{                                                                             
    struct icmp6_filter filter;                                               
                                                                              
    ICMP6_FILTER_SETPASS(ND_ROUTER_ADVERT, &filter);                          
                                                                              
    return EXIT_SUCCESS;                                                      
}

compiled with "gcc icmp6_test.c -Wsign-conversion" gives a warning

icmp6_test.c: In function ‘main’:
icmp6_test.c:8:2: warning: negative integer implicitly converted to unsigned type [-Wsign-conversion]
  ICMP6_FILTER_SETPASS(ND_ROUTER_ADVERT, &filter);
Comment 1 Roy Marples 2020-04-23 15:39:33 UTC
Can this be progressed please?

Compiling dhcpcd with debugging flags always throws this up and it's highly annoying. I can confirm this patch removes the warning generated.
Comment 2 dj@redhat.com 2020-05-13 18:44:34 UTC
Fixed in upstream c2d0411488c68a07cc22a5dd76fa37e952d2a66b