aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAnthony Ramine <[email protected]>2013-11-21 18:18:42 +0100
committerHenrik Nord <[email protected]>2013-12-02 15:20:50 +0100
commit80f95d2ab4352eef90ae2546a8e42f4ed82cd738 (patch)
tree54f229e75f4d89b33b637684d634dd009406a210 /lib
parentf8c1256fc624ef79aa4f25574278c0cd2f9f1106 (diff)
downloadotp-80f95d2ab4352eef90ae2546a8e42f4ed82cd738.tar.gz
otp-80f95d2ab4352eef90ae2546a8e42f4ed82cd738.tar.bz2
otp-80f95d2ab4352eef90ae2546a8e42f4ed82cd738.zip
Silence warnings about socklen_t pointers sign in erl_memory
erl_memory.c:947:7: warning: passing 'int *' to parameter of type 'socklen_t *' (aka 'unsigned int *') converts between pointers to integer types with different sign [-Wpointer-sign] &saddr_size) != 0) ^~~~~~~~~~~ /usr/include/sys/socket.h:616:74: note: passing argument to parameter here int getsockname(int, struct sockaddr * __restrict, socklen_t * __restrict) ^ erl_memory.c:2613:57: warning: passing 'int *' to parameter of type 'socklen_t *' (aka 'unsigned int *') converts between pointers to integer types with different sign [-Wpointer-sign] sock = accept(lsock, (struct sockaddr *) &oth_addr, &oth_addr_len); ^~~~~~~~~~~~~ /usr/include/sys/socket.h:610:69: note: passing argument to parameter here int accept(int, struct sockaddr * __restrict, socklen_t * __restrict) ^
Diffstat (limited to 'lib')
-rw-r--r--lib/tools/c_src/erl_memory.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/tools/c_src/erl_memory.c b/lib/tools/c_src/erl_memory.c
index 398b320041..c4e126a7b1 100644
--- a/lib/tools/c_src/erl_memory.c
+++ b/lib/tools/c_src/erl_memory.c
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2003-2012. All Rights Reserved.
+ * Copyright Ericsson AB 2003-2013. All Rights Reserved.
*
* The contents of this file are subject to the Erlang Public License,
* Version 1.1, (the "License"); you may not use this file except in
@@ -30,6 +30,7 @@
# undef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
+typedef int socklen_t;
#else
# if defined(__linux__) && defined(__GNUC__)
# define _GNU_SOURCE 1
@@ -938,7 +939,7 @@ print_emu_arg(em_state *state)
struct hostent *hp;
struct in_addr iaddr;
usgnd_int_16 port;
- int saddr_size = sizeof(saddr);
+ socklen_t saddr_size = sizeof(saddr);
size_t size;
char *format = "> Emulator command line argument: +Mit %s\n";
@@ -2555,7 +2556,7 @@ init_connection(em_state *state)
SOCKET lsock;
SOCKET sock = INVALID_SOCKET;
struct sockaddr_in my_addr;
- int oth_addr_len;
+ socklen_t oth_addr_len;
struct sockaddr_in oth_addr;
#ifdef __WIN32__
WORD wVersionRequested = MAKEWORD(2,0);