[前][次][番号順一覧][スレッド一覧]

ruby-changes:40115

From: nobu <ko1@a...>
Date: Tue, 20 Oct 2015 01:29:11 +0900 (JST)
Subject: [ruby-changes:40115] nobu:r52196 (trunk): suppress a warning

nobu	2015-10-20 01:28:56 +0900 (Tue, 20 Oct 2015)

  New Revision: 52196

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=52196

  Log:
    suppress a warning
    
    * ext/socket/raddrinfo.c (rsock_fd_family): suppress a
      sign-compare warning.

  Modified files:
    trunk/ext/socket/raddrinfo.c
Index: ext/socket/raddrinfo.c
===================================================================
--- ext/socket/raddrinfo.c	(revision 52195)
+++ ext/socket/raddrinfo.c	(revision 52196)
@@ -525,7 +525,7 @@ rsock_fd_family(int fd) https://github.com/ruby/ruby/blob/trunk/ext/socket/raddrinfo.c#L525
     socklen_t sa_len = sizeof(sa);
 
     if (fd < 0 || getsockname(fd, &sa, &sa_len) != 0 ||
-        sa_len < offsetof(struct sockaddr, sa_family) + sizeof(sa.sa_family)) {
+        (size_t)sa_len < offsetof(struct sockaddr, sa_family) + sizeof(sa.sa_family)) {
 	return AF_UNSPEC;
     }
     return sa.sa_family;

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]