typecheck-gcc: fix _curl_is_slist_info

Info values starting with CURLINFO_SOCKET expect a curl_socket_t, not a
curl_slist argument.

This fixes the following GCC warning when building the examples with
--enable-optimize:

../../include/curl/typecheck-gcc.h:126:42: warning: call to
‘_curl_easy_getinfo_err_curl_slist’ declared with attribute warning:
curl_easy_getinfo expects a pointer to 'struct curl_slist *' for this
info [enabled by default]
sendrecv.c:90:11: note: in expansion of macro ‘curl_easy_getinfo’
res = curl_easy_getinfo(curl, CURLINFO_ACTIVESOCKET, &sockfd);

Closes https://github.com/curl/curl/pull/1447
This commit is contained in:
Marcel Raad 2017-04-24 17:56:19 +02:00
parent 96ece5c0ee
commit 9c5aed1852
No known key found for this signature in database
GPG Key ID: B7F13D981BBF1607
1 changed files with 1 additions and 1 deletions

View File

@ -349,7 +349,7 @@ _CURL_WARNING(_curl_easy_getinfo_err_curl_slist,
/* true if info expects a pointer to struct curl_slist * argument */
#define _curl_is_slist_info(info) \
(CURLINFO_SLIST < (info))
(CURLINFO_SLIST < (info) && (info) < CURLINFO_SOCKET)
/* typecheck helpers -- check whether given expression has requested type*/