I'm using libuv 1.8 release.
/3rd_party/libuv/src/fs-poll.c:187:25: warning: implicit conversion loses integer precision: 'ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
req->result,
~^~
/3rd_party/libuv/src/fs-poll.c:190:32: warning: implicit conversion loses integer precision: 'ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
ctx->busy_polling = req->result;
~ ~^~
/3rd_party/libuv/src/inet.c:175:15: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
len = p - src;
~ ^~~
/3rd_party/libuv/src/inet.c:202:34: warning: implicit conversion loses integer precision: 'long' to 'unsigned int' [-Wshorten-64-to-32]
unsigned int nw = *tp * 10 + (pch - digits);
~~ ~~~^~~~^
/3rd_party/libuv/src/inet.c:298:22: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
const int n = tp - colonp;
~ ~~~~
/3rd_party/libuv/src/unix/async.c:161:9: warning: implicit conversion loses integer precision: 'ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
r = write(fd, buf, len);
~ ^~~~~~~
/3rd_party/libuv/src/unix/fs.c:919:3: warning: implicit conversion loses integer precision: 'ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
POST;
^~
/3rd_party/libuv/src/unix/fs.c:117:19: note: expanded from macro 'POST'
return req->result;
~~ ~^~~
/3rd_party/libuv/src/unix/fs.c:931:3: warning: implicit conversion loses integer precision: 'ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
POST;
^
/3rd_party/libuv/src/unix/fs.c:117:19: note: expanded from macro 'POST'
return req->result;
~~ ~^~
/3rd_party/libuv/src/unix/fs.c:945:3: warning: implicit conversion loses integer precision: 'ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
POST;
^~
/3rd_party/libuv/src/unix/fs.c:117:19: note: expanded from macro 'POST'
return req->result;
~~ ~^~~
/3rd_party/libuv/src/unix/fs.c:952:3: warning: implicit conversion loses integer precision: 'ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
POST;
^
/3rd_party/libuv/src/unix/fs.c:117:19: note: expanded from macro 'POST'
return req->result;
~~ ~^~
/3rd_party/libuv/src/unix/fs.c:964:3: warning: implicit conversion loses integer precision: 'ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
POST;
^~
/3rd_party/libuv/src/unix/fs.c:117:19: note: expanded from macro 'POST'
return req->result;
~~ ~^~~
/3rd_party/libuv/src/unix/fs.c:978:3: warning: implicit conversion loses integer precision: 'ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
POST;
^
/3rd_party/libuv/src/unix/fs.c:117:19: note: expanded from macro 'POST'
return req->result;
~~ ~^~
/3rd_party/libuv/src/unix/fs.c:985:3: warning: implicit conversion loses integer precision: 'ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
POST;
^~
/3rd_party/libuv/src/unix/fs.c:117:19: note: expanded from macro 'POST'
return req->result;
~~ ~^~~
/3rd_party/libuv/src/unix/fs.c:992:3: warning: implicit conversion loses integer precision: 'ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
POST;
^
/3rd_party/libuv/src/unix/fs.c:117:19: note: expanded from macro 'POST'
return req->result;
~~ ~^~
/3rd_party/libuv/src/unix/fs.c:999:3: warning: implicit conversion loses integer precision: 'ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
POST;
^~
/3rd_party/libuv/src/unix/fs.c:117:19: note: expanded from macro 'POST'
return req->result;
~~ ~^~~
/3rd_party/libuv/src/unix/fs.c:1011:3: warning: implicit conversion loses integer precision: 'ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
POST;
^
/3rd_party/libuv/src/unix/fs.c:117:19: note: expanded from macro 'POST'
return req->result;
~~ ~^~
/3rd_party/libuv/src/unix/fs.c:1025:3: warning: implicit conversion loses integer precision: 'ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
POST;
^~
/3rd_party/libuv/src/unix/fs.c:117:19: note: expanded from macro 'POST'
return req->result;
~~ ~^~~
/3rd_party/libuv/src/unix/fs.c:1032:3: warning: implicit conversion loses integer precision: 'ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
POST;
^
/3rd_party/libuv/src/unix/fs.c:117:19: note: expanded from macro 'POST'
return req->result;
~~ ~^~
/3rd_party/libuv/src/unix/fs.c:1043:3: warning: implicit conversion loses integer precision: 'ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
POST;
^~
/3rd_party/libuv/src/unix/fs.c:117:19: note: expanded from macro 'POST'
return req->result;
~~ ~^~~
/3rd_party/libuv/src/unix/fs.c:1055:3: warning: implicit conversion loses integer precision: 'ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
POST;
^
/3rd_party/libuv/src/unix/fs.c:117:19: note: expanded from macro 'POST'
return req->result;
~~ ~^~
/3rd_party/libuv/src/unix/fs.c:1067:3: warning: implicit conversion loses integer precision: 'ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
POST;
^~
/3rd_party/libuv/src/unix/fs.c:117:19: note: expanded from macro 'POST'
return req->result;
~~ ~^~~
/3rd_party/libuv/src/unix/fs.c:1081:3: warning: implicit conversion loses integer precision: 'ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
POST;
^
/3rd_party/libuv/src/unix/fs.c:117:19: note: expanded from macro 'POST'
return req->result;
~~ ~^~
/3rd_party/libuv/src/unix/fs.c:1108:3: warning: implicit conversion loses integer precision: 'ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
POST;
^~
/3rd_party/libuv/src/unix/fs.c:117:19: note: expanded from macro 'POST'
return req->result;
~~ ~^~~
/3rd_party/libuv/src/unix/fs.c:1120:3: warning: implicit conversion loses integer precision: 'ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
POST;
^
/3rd_party/libuv/src/unix/fs.c:117:19: note: expanded from macro 'POST'
return req->result;
~~ ~^~
/3rd_party/libuv/src/unix/fs.c:1130:3: warning: implicit conversion loses integer precision: 'ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
POST;
^~
/3rd_party/libuv/src/unix/fs.c:117:19: note: expanded from macro 'POST'
return req->result;
~~ ~^~~
/3rd_party/libuv/src/unix/fs.c:1141:3: warning: implicit conversion loses integer precision: 'ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
POST;
^
/3rd_party/libuv/src/unix/fs.c:117:19: note: expanded from macro 'POST'
return req->result;
~~ ~^~
/3rd_party/libuv/src/unix/fs.c:1148:3: warning: implicit conversion loses integer precision: 'ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
POST;
^~
/3rd_party/libuv/src/unix/fs.c:117:19: note: expanded from macro 'POST'
return req->result;
~~ ~^~~
/3rd_party/libuv/src/unix/fs.c:1164:3: warning: implicit conversion loses integer precision: 'ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
POST;
^
/3rd_party/libuv/src/unix/fs.c:117:19: note: expanded from macro 'POST'
return req->result;
~~ ~^~
/3rd_party/libuv/src/unix/fs.c:1171:3: warning: implicit conversion loses integer precision: 'ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
POST;
^~
/3rd_party/libuv/src/unix/fs.c:117:19: note: expanded from macro 'POST'
return req->result;
~~ ~^~~
/3rd_party/libuv/src/unix/fs.c:1184:3: warning: implicit conversion loses integer precision: 'ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
POST;
^
/3rd_party/libuv/src/unix/fs.c:117:19: note: expanded from macro 'POST'
return req->result;
~~ ~^~
/3rd_party/libuv/src/unix/fs.c:1191:3: warning: implicit conversion loses integer precision: 'ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
POST;
^~
/3rd_party/libuv/src/unix/fs.c:117:19: note: expanded from macro 'POST'
return req->result;
~~ ~^~~
/3rd_party/libuv/src/unix/fs.c:1205:3: warning: implicit conversion loses integer precision: 'ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
POST;
^
/3rd_party/libuv/src/unix/fs.c:117:19: note: expanded from macro 'POST'
return req->result;
~~ ~^~
/3rd_party/libuv/src/unix/fs.c:1233:3: warning: implicit conversion loses integer precision: 'ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
POST;
^~
/3rd_party/libuv/src/unix/fs.c:117:19: note: expanded from macro 'POST'
return req->result;
~~ ~^~
/3rd_party/libuv/src/unix/pipe.c:234:15: warning: implicit conversion loses integer precision: 'unsigned long' to 'socklen_t' (aka 'unsigned int') [-Wshorten-64-to-32]
addrlen = strlen(sa.sun_path);
~ ^~~~~
/3rd_party/libuv/src/unix/signal.c:77:9: warning: implicit conversion loses integer precision: 'ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
r = read(uv__signal_lock_pipefd[0], &data, sizeof data);
~ ^~~~~~~~~~~
/3rd_party/libuv/src/unix/signal.c:89:9: warning: implicit conversion loses integer precision: 'ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
r = write(uv__signal_lock_pipefd[1], &data, sizeof data);
~ ^~~~~~~~~~~~
/3rd_party/libuv/src/unix/signal.c:162:11: warning: implicit conversion loses integer precision: 'ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
r = write(handle->loop->signal_pipefd[1], &msg, sizeof msg);
~ ^~~~~~~~~~~~~
/3rd_party/libuv/src/unix/signal.c:354:9: warning: implicit conversion loses integer precision: 'ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
r = read(loop->signal_pipefd[0], buf + bytes, sizeof(buf) - bytes);
~ ^~~~~~~~~~~~~~
/3rd_party/libuv/src/unix/stream.c:124:9: warning: implicit conversion loses integer precision: 'ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
r = write(s->fake_fd, "x", 1);
~ ^~~~~~~
/3rd_party/libuv/src/unix/stream.c:185:13: warning: implicit conversion loses integer precision: 'ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
r = read(s->int_fd, buf, sizeof(buf));
~ ^~~~~~~~~
/3rd_party/libuv/src/unix/stream.c:1477:12: warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32]
return written;
~~ ^~~
/3rd_party/libuv/src/unix/timer.c:146:10: warning: implicit conversion loses integer precision: 'uint64_t' (aka 'unsigned long long') to 'int' [-Wshorten-64-to-32]
return diff;
^~~~
/3rd_party/libuv/src/unix/udp.c:118:30: warning: implicit conversion loses integer precision: 'ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
req->send_cb(req, req->status);
~~~ ~~~~~^~~~~~
/3rd_party/libuv/src/unix/udp.c:468:10: warning: implicit conversion loses integer precision: 'ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
return size;
~~~~~~ ^~~~
/3rd_party/libuv/src/unix/udp.c:652:20: warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'socklen_t' (aka 'unsigned int') [-Wshorten-64-to-32]
size);
^~~~
/3rd_party/libuv/src/unix/udp.c:658:20: warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'socklen_t' (aka 'unsigned int') [-Wshorten-64-to-32]
size);
^~~~
/3rd_party/libuv/src/unix/darwin.c:219:31: warning: implicit conversion loses integer precision: 'unsigned long long' to 'int' [-Wshorten-64-to-32]
cpu_info->speed = cpuspeed/1000000;
~ ~~~~~~~~^~~~~~~~
/3rd_party/libuv/src/unix/kqueue.c:184:16: warning: implicit conversion loses integer precision: 'uintptr_t' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32]
fd = ev->ident;
~ ~~~~^~~~~
/3rd_party/libuv/src/unix/kqueue.c:216:27: warning: implicit conversion loses integer precision: 'intptr_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
w->rcount = ev->data;
~ ~~~~^~~~
/3rd_party/libuv/src/unix/kqueue.c:230:27: warning: implicit conversion loses integer precision: 'intptr_t' (aka 'long') to 'int' [-Wshorten-64-to-32]
w->wcount = ev->data;
~ ~~~~^~~~
I guess this is somehow OS-dependent, as I don't have any conversion warnings on Debian arm64 builders.
I believe it's a non-default warning, since it's also a common C idiom. I think you should be able to emit them in your local build (any architecture) by calling make CFLAGS='-Wconversion' (the above lists -Wshorten-64-to-32, but I don't see that in my gcc man page)
@lucab The size of data types are mostly implementation dependent. If you compiler doesn't emit a warning, either the warning is disabled or size_t is the same size as a DWORD (This is the case for MSVC in 32 bits).
Good portable code should never assume that such a type as size_t has the same size as a DWORD or any other type. Appropriate cast should be used and if lost of precision due to casting could be a problem a warning should be conditionally compiled.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
@vtjnash @saghul can you maybe add the not-stale label here?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Most helpful comment
@lucab The size of data types are mostly implementation dependent. If you compiler doesn't emit a warning, either the warning is disabled or size_t is the same size as a DWORD (This is the case for MSVC in 32 bits).
Good portable code should never assume that such a type as size_t has the same size as a DWORD or any other type. Appropriate cast should be used and if lost of precision due to casting could be a problem a warning should be conditionally compiled.