Skip to content

Commit

Permalink
Cygwin: Fix warnings about narrowing conversions of socket ioctls
Browse files Browse the repository at this point in the history
Fix gcc 12 warnings about narrowing conversions of socket ioctl constants
when used as case labels, e.g:

> ../../../../src/winsup/cygwin/net.cc: In function ‘int get_ifconf(ifconf*, int)’:
> ../../../../src/winsup/cygwin/net.cc:1940:18: error: narrowing conversion of ‘2152756069’ from ‘long int’ to ‘int’ [-Wnarrowing]

Signed-off-by: Jon Turney <[email protected]>
  • Loading branch information
jon-turney committed Aug 13, 2024
1 parent 50cf10d commit 80e7ed9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion winsup/cygwin/fhandler/socket.cc
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ struct __old_ifreq {
int
fhandler_socket::ioctl (unsigned int cmd, void *p)
{
extern int get_ifconf (struct ifconf *ifc, int what); /* net.cc */
extern int get_ifconf (struct ifconf *ifc, unsigned int what); /* net.cc */
int res;
struct ifconf ifc, *ifcp;
struct ifreq *ifrp;
Expand Down
2 changes: 1 addition & 1 deletion winsup/cygwin/net.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1912,7 +1912,7 @@ freeifaddrs (struct ifaddrs *ifp)
}

int
get_ifconf (struct ifconf *ifc, int what)
get_ifconf (struct ifconf *ifc, unsigned int what)
{
__try
{
Expand Down

0 comments on commit 80e7ed9

Please sign in to comment.