mirror of
https://github.com/curl/curl.git
synced 2026-08-25 23:33:37 +03:00
examples: fix/silence -Wsign-conversion
- extend `FD_SET()` hack to all platforms (was only Cygwin).
Warnings may also happen in other envs, e.g. OmniOS.
Ref: https://github.com/libssh2/libssh2/actions/runs/8854199687/job/24316762831#step:3:2021
- tidy-up `CURLcode` vs `int` use.
- cast an unsigned to `long` before passing to `curl_easy_setopt()`.
Cherry-picked from #13489
Follow-up to 3829759bd0 #12489
Closes #13501
This commit is contained in:
parent
7ca0a3791b
commit
5b9955e0bd
4 changed files with 8 additions and 11 deletions
|
|
@ -48,7 +48,7 @@ static int wait_on_socket(curl_socket_t sockfd, int for_recv, long timeout_ms)
|
|||
* warning: conversion to 'long unsigned int' from 'curl_socket_t' {aka 'int'}
|
||||
* may change the sign of the result [-Wsign-conversion]
|
||||
*/
|
||||
#if defined(__GNUC__) && defined(__CYGWIN__)
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wsign-conversion"
|
||||
#endif
|
||||
|
|
@ -60,7 +60,7 @@ static int wait_on_socket(curl_socket_t sockfd, int for_recv, long timeout_ms)
|
|||
else {
|
||||
FD_SET(sockfd, &outfd);
|
||||
}
|
||||
#if defined(__GNUC__) && defined(__CYGWIN__)
|
||||
#if defined(__GNUC__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue