[newlib-cygwin/cygwin-3_5-branch] Cygwin: Fix warnings about narrowing conversions of socket ioctls
Corinna Vinschen
corinna@sourceware.org
Thu Aug 22 20:37:55 GMT 2024
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=510cbdf32abc5c9f3a2cbdb12930e27f0f6b54e1
commit 510cbdf32abc5c9f3a2cbdb12930e27f0f6b54e1
Author: Jon Turney <jon.turney@dronecode.org.uk>
AuthorDate: Sun Aug 4 17:02:00 2024 +0100
Commit: Corinna Vinschen <corinna@vinschen.de>
CommitDate: Thu Aug 22 19:58:49 2024 +0200
Cygwin: Fix warnings about narrowing conversions of socket ioctls
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 <jon.turney@dronecode.org.uk>
Diff:
---
winsup/cygwin/fhandler/socket.cc | 2 +-
winsup/cygwin/net.cc | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/winsup/cygwin/fhandler/socket.cc b/winsup/cygwin/fhandler/socket.cc
index f7c5ff6294b4..c0cef7d3eeb1 100644
--- a/winsup/cygwin/fhandler/socket.cc
+++ b/winsup/cygwin/fhandler/socket.cc
@@ -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;
diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc
index 08c584fe5340..737e494f8f4a 100644
--- a/winsup/cygwin/net.cc
+++ b/winsup/cygwin/net.cc
@@ -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
{
More information about the Cygwin-cvs
mailing list