[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 112/153: curl-compilers: enable -Wbad-function-cast
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 112/153: curl-compilers: enable -Wbad-function-cast on GCC |
Date: |
Tue, 11 Sep 2018 12:53:03 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit 60776a0515c2a8f572902ad5bcc9f63eeaeafa84
Author: Marcel Raad <address@hidden>
AuthorDate: Mon Jul 9 18:43:55 2018 +0200
curl-compilers: enable -Wbad-function-cast on GCC
This warning used to be enabled only for clang as it's a bit stricter
on GCC. Silence the remaining occurrences and enable it on GCC too.
Closes https://github.com/curl/curl/pull/2747
---
docs/examples/sslbackend.c | 4 ++--
m4/curl-compilers.m4 | 1 +
src/tool_cb_see.c | 4 +++-
tests/libtest/lib650.c | 5 ++++-
tests/server/sockfilt.c | 3 ++-
5 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/docs/examples/sslbackend.c b/docs/examples/sslbackend.c
index 1483dcc2e..c1489a9aa 100644
--- a/docs/examples/sslbackend.c
+++ b/docs/examples/sslbackend.c
@@ -57,9 +57,9 @@ int main(int argc, char **argv)
return 0;
}
else if(isdigit(*name)) {
- curl_sslbackend id = (curl_sslbackend)atoi(name);
+ int id = atoi(name);
- result = curl_global_sslset(id, NULL, NULL);
+ result = curl_global_sslset((curl_sslbackend)id, NULL, NULL);
}
else
result = curl_global_sslset(-1, name, NULL);
diff --git a/m4/curl-compilers.m4 b/m4/curl-compilers.m4
index c1ae6a559..63e45f3e0 100644
--- a/m4/curl-compilers.m4
+++ b/m4/curl-compilers.m4
@@ -977,6 +977,7 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [
dnl Only gcc 2.95 or later
if test "$compiler_num" -ge "295"; then
tmp_CFLAGS="$tmp_CFLAGS -Wno-long-long"
+ tmp_CFLAGS="$tmp_CFLAGS -Wbad-function-cast"
fi
#
dnl Only gcc 2.96 or later
diff --git a/src/tool_cb_see.c b/src/tool_cb_see.c
index 621d440f4..061b2bb3d 100644
--- a/src/tool_cb_see.c
+++ b/src/tool_cb_see.c
@@ -118,10 +118,12 @@ int tool_seek_cb(void *userdata, curl_off_t offset, int
whence)
int tool_ftruncate64(int fd, curl_off_t where)
{
+ intptr_t handle = _get_osfhandle(fd);
+
if(_lseeki64(fd, where, SEEK_SET) < 0)
return -1;
- if(!SetEndOfFile((HANDLE)_get_osfhandle(fd)))
+ if(!SetEndOfFile((HANDLE)handle))
return -1;
return 0;
diff --git a/tests/libtest/lib650.c b/tests/libtest/lib650.c
index 056270cfb..79d60b624 100644
--- a/tests/libtest/lib650.c
+++ b/tests/libtest/lib650.c
@@ -62,6 +62,7 @@ int test(char *URL)
struct curl_forms formarray[3];
size_t formlength = 0;
char flbuf[32];
+ long contentlength = 0;
if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
fprintf(stderr, "curl_global_init() failed\n");
@@ -94,11 +95,13 @@ int test(char *URL)
goto test_cleanup;
}
+ contentlength = (long)(strlen(data) - 1);
+
/* Use a form array for the non-copy test. */
formarray[0].option = CURLFORM_PTRCONTENTS;
formarray[0].value = data;
formarray[1].option = CURLFORM_CONTENTSLENGTH;
- formarray[1].value = (char *) strlen(data) - 1;
+ formarray[1].value = (char *)(size_t)contentlength;
formarray[2].option = CURLFORM_END;
formarray[2].value = NULL;
formrc = curl_formadd(&formpost,
diff --git a/tests/server/sockfilt.c b/tests/server/sockfilt.c
index 2fb947f15..10a16ef00 100644
--- a/tests/server/sockfilt.c
+++ b/tests/server/sockfilt.c
@@ -782,8 +782,9 @@ static int select_ws(int nfds, fd_set *readfds, fd_set
*writefds,
wsa++;
}
else {
+ curl_socket_t socket = curlx_sitosk(fds);
WSACloseEvent(wsaevent);
- handle = (HANDLE) curlx_sitosk(fds);
+ handle = (HANDLE) socket;
handle = select_ws_wait(handle, waitevent);
handles[nfd] = handle;
data[thd].thread = handle;
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnurl] 72/153: README.md: add LGTM.com code quality grade for C/C++, (continued)
- [GNUnet-SVN] [gnurl] 72/153: README.md: add LGTM.com code quality grade for C/C++, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 107/153: http2: avoid set_stream_user_data() before stream is assigned, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 118/153: http2: abort the send_callback if not setup yet, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 117/153: http2: remove four unused nghttp2 callbacks, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 123/153: gopher: Do not translate `?' to `%09', gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 120/153: RELEASE-NOTES: synced, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 122/153: cookie tests: treat files as text, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 114/153: Enable more GCC warnings, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 119/153: Tests: fixes for Windows, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 121/153: libcurl-thread.3: expand somewhat on the NO_SIGNAL motivation, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 112/153: curl-compilers: enable -Wbad-function-cast on GCC,
gnunet <=
- [GNUnet-SVN] [gnurl] 115/153: test1148: disable if decimal separator is not point, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 111/153: configure: conditionally enable pedantic-errors, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 116/153: x509asn1: use FALLTHROUGH, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 100/153: http2: make sure to send after RST_STREAM, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 128/153: docs: clarify NO_PROXY env variable functionality, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 99/153: test1268: check the stderr output as "text", gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 106/153: SSLCERTS: improve the openssl command line, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 108/153: INTERNALS: require GnuTLS >= 2.11.3, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 89/153: travis: disable h2 torture tests for "coverage", gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 93/153: CMake: CMake config files are defining CURL_STATICLIB for static builds, gnunet, 2018/09/11