[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnurl] 14/29: lib: fix compiler warnings with `CURL_DISABLE_VERBOSE_STR
From: |
gnunet |
Subject: |
[gnurl] 14/29: lib: fix compiler warnings with `CURL_DISABLE_VERBOSE_STRINGS` |
Date: |
Fri, 10 Jan 2020 23:05:52 +0100 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit 291ed52122619c502432e00a5115057f51d21e6a
Author: Marcel Raad <address@hidden>
AuthorDate: Fri Jan 3 13:30:34 2020 +0100
lib: fix compiler warnings with `CURL_DISABLE_VERBOSE_STRINGS`
Closes https://github.com/curl/curl/pull/4775
---
lib/connect.c | 12 ++++++------
lib/http.c | 4 ++--
lib/strerror.c | 5 ++++-
lib/vtls/schannel.c | 4 +++-
4 files changed, 15 insertions(+), 10 deletions(-)
diff --git a/lib/connect.c b/lib/connect.c
index 3b88a5962..611d6d2f0 100644
--- a/lib/connect.c
+++ b/lib/connect.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2019, Daniel Stenberg, <address@hidden>, et al.
+ * Copyright (C) 1998 - 2020, Daniel Stenberg, <address@hidden>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -932,9 +932,11 @@ CURLcode Curl_is_connected(struct connectdata *conn,
SET_SOCKERRNO(error);
if(conn->tempaddr[i]) {
CURLcode status;
+#ifndef CURL_DISABLE_VERBOSE_STRINGS
char ipaddress[MAX_IPADR_LEN];
char buffer[STRERROR_LEN];
Curl_printable_address(conn->tempaddr[i], ipaddress, MAX_IPADR_LEN);
+#endif
infof(data, "connect to %s port %ld failed: %s\n",
ipaddress, conn->port,
Curl_strerror(error, buffer, sizeof(buffer)));
@@ -992,14 +994,12 @@ CURLcode Curl_is_connected(struct connectdata *conn,
static void tcpnodelay(struct connectdata *conn, curl_socket_t sockfd)
{
#if defined(TCP_NODELAY)
-#if !defined(CURL_DISABLE_VERBOSE_STRINGS)
- struct Curl_easy *data = conn->data;
-#endif
curl_socklen_t onoff = (curl_socklen_t) 1;
int level = IPPROTO_TCP;
+#if !defined(CURL_DISABLE_VERBOSE_STRINGS)
+ struct Curl_easy *data = conn->data;
char buffer[STRERROR_LEN];
-
-#if defined(CURL_DISABLE_VERBOSE_STRINGS)
+#else
(void) conn;
#endif
diff --git a/lib/http.c b/lib/http.c
index 35d2e9fb0..837f53c41 100644
--- a/lib/http.c
+++ b/lib/http.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2019, Daniel Stenberg, <address@hidden>, et al.
+ * Copyright (C) 1998 - 2020, Daniel Stenberg, <address@hidden>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -641,7 +641,7 @@ output_auth_headers(struct connectdata *conn,
{
const char *auth = NULL;
CURLcode result = CURLE_OK;
-#if !defined(CURL_DISABLE_VERBOSE_STRINGS) || defined(USE_SPNEGO)
+#if !defined(CURL_DISABLE_VERBOSE_STRINGS)
struct Curl_easy *data = conn->data;
#endif
diff --git a/lib/strerror.c b/lib/strerror.c
index f4f5a93a4..29df5aa55 100644
--- a/lib/strerror.c
+++ b/lib/strerror.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 2004 - 2019, Daniel Stenberg, <address@hidden>, et al.
+ * Copyright (C) 2004 - 2020, Daniel Stenberg, <address@hidden>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -449,7 +449,9 @@ curl_share_strerror(CURLSHcode error)
static const char *
get_winsock_error (int err, char *buf, size_t len)
{
+#ifndef CURL_DISABLE_VERBOSE_STRINGS
const char *p;
+#endif
if(!len)
return NULL;
@@ -457,6 +459,7 @@ get_winsock_error (int err, char *buf, size_t len)
*buf = '\0';
#ifdef CURL_DISABLE_VERBOSE_STRINGS
+ (void)err;
return NULL;
#else
switch(err) {
diff --git a/lib/vtls/schannel.c b/lib/vtls/schannel.c
index 5ab093b38..dc58ed0d3 100644
--- a/lib/vtls/schannel.c
+++ b/lib/vtls/schannel.c
@@ -7,7 +7,7 @@
*
* Copyright (C) 2012 - 2016, Marc Hoersken, <address@hidden>
* Copyright (C) 2012, Mark Salisbury, <address@hidden>
- * Copyright (C) 2012 - 2019, Daniel Stenberg, <address@hidden>, et al.
+ * Copyright (C) 2012 - 2020, Daniel Stenberg, <address@hidden>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -1855,7 +1855,9 @@ schannel_recv(struct connectdata *conn, int sockindex,
goto cleanup;
}
else {
+#ifndef CURL_DISABLE_VERBOSE_STRINGS
char buffer[STRERROR_LEN];
+#endif
*err = CURLE_RECV_ERROR;
infof(data, "schannel: failed to read data from server: %s\n",
Curl_sspi_strerror(sspi_status, buffer, sizeof(buffer)));
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [gnurl] 11/29: tool: make a few char pointers point to const char instead, (continued)
- [gnurl] 11/29: tool: make a few char pointers point to const char instead, gnunet, 2020/01/10
- [gnurl] 23/29: file: fix copyright year range, gnunet, 2020/01/10
- [gnurl] 12/29: tests: Fix bounce requests with truncated writes, gnunet, 2020/01/10
- [gnurl] 21/29: file: on Windows, refuse paths that start with \\, gnunet, 2020/01/10
- [gnurl] 20/29: CURLOPT_READFUNCTION.3: fix fopen params in example, gnunet, 2020/01/10
- [gnurl] 19/29: CURLOPT_READFUNCTION.3: fix variable name in example, gnunet, 2020/01/10
- [gnurl] 13/29: COPYING: it's 2020!, gnunet, 2020/01/10
- [gnurl] 24/29: multi.h: move INITIAL_MAX_CONCURRENT_STREAMS from public header, gnunet, 2020/01/10
- [gnurl] 17/29: docs: mention CURL_MAX_INPUT_LENGTH restrictions, gnunet, 2020/01/10
- [gnurl] 26/29: RELEASE-PROCEDURE: add four future release dates, gnunet, 2020/01/10
- [gnurl] 14/29: lib: fix compiler warnings with `CURL_DISABLE_VERBOSE_STRINGS`,
gnunet <=
- [gnurl] 22/29: curl -w: handle a blank input file correctly, gnunet, 2020/01/10
- [gnurl] 18/29: curl:getparameter return error for --http3 if libcurl doesn't support, gnunet, 2020/01/10
- [gnurl] 25/29: TrackMemory tests: always remove CR before LF, gnunet, 2020/01/10
- [gnurl] 15/29: curl: cleanup multi handle on failure, gnunet, 2020/01/10
- [gnurl] 16/29: curl: properly free mimepost data, gnunet, 2020/01/10
- [gnurl] 27/29: THANKS: updated with names from the 7.68.0 release, gnunet, 2020/01/10
- [gnurl] 28/29: RELEASE-NOTES: 7.68.0, gnunet, 2020/01/10
- [gnurl] 29/29: Merge tag 'curl-7_68_0', gnunet, 2020/01/10