diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2019-07-13 14:27:49 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2019-07-13 18:40:06 +0200 |
commit | 319e0f097d125dfcaf3933e57bc650d112170035 (patch) | |
tree | ac42dfd24e5d8b987170b69f4145751cd929f07f /src/network/socket/qnativesocketengine_unix.cpp | |
parent | eaf2e6daf6cba6a479d102f3d904c389ca2294e3 (diff) | |
download | qtbase-319e0f097d125dfcaf3933e57bc650d112170035.tar.gz |
QNativeSocketEngine: disable sign-compare warning-turned-error on Clang
On the WASM platform, the macro CMDG_NEXTHDR, which is not under our
control, emits a warning about comparing ulong and long with each
other, which -Werror turns into an error:
qnativesocketengine_unix.cpp:1004:24: error: comparison of integers of different signs: 'unsigned long' and 'long' [-Werror,-Wsign-compare]
cmsgptr = CMSG_NXTHDR(&msg, cmsgptr)) {
^~~~~~~~~~~~~~~~~~~~~~~~~~
emsdk/emscripten/1.38.30/system/include/libc/sys/socket.h:286:44: note: expanded from macro 'CMSG_NXTHDR'
__CMSG_LEN(cmsg) + sizeof(struct cmsghdr) >= __MHDR_END(mhdr) - (unsigned char *)(cmsg) \
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Fix by locally disabling the warning.
Change-Id: Ia2ed4318b2ef679b84ac8544835d1e383568ccac
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/network/socket/qnativesocketengine_unix.cpp')
-rw-r--r-- | src/network/socket/qnativesocketengine_unix.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/network/socket/qnativesocketengine_unix.cpp b/src/network/socket/qnativesocketengine_unix.cpp index 24c17124dc..3ca586e247 100644 --- a/src/network/socket/qnativesocketengine_unix.cpp +++ b/src/network/socket/qnativesocketengine_unix.cpp @@ -1000,8 +1000,11 @@ qint64 QNativeSocketEnginePrivate::nativeReceiveDatagram(char *data, qint64 maxS // parse the ancillary data struct cmsghdr *cmsgptr; + QT_WARNING_PUSH + QT_WARNING_DISABLE_CLANG("-Wsign-compare") for (cmsgptr = CMSG_FIRSTHDR(&msg); cmsgptr != NULL; cmsgptr = CMSG_NXTHDR(&msg, cmsgptr)) { + QT_WARNING_POP if (cmsgptr->cmsg_level == IPPROTO_IPV6 && cmsgptr->cmsg_type == IPV6_PKTINFO && cmsgptr->cmsg_len >= CMSG_LEN(sizeof(in6_pktinfo))) { in6_pktinfo *info = reinterpret_cast<in6_pktinfo *>(CMSG_DATA(cmsgptr)); |