build: globally suppress DJGPP warnings in FD_SET()

Replacing the many local `#pragma` used before this patch,
reducing the number of `__DJGPP__` guards from 58 to 13.

Closes #20299
This commit is contained in:
Viktor Szakats 2026-01-13 22:07:53 +01:00
parent ad8374aedc
commit 0431cbe71a
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
13 changed files with 13 additions and 157 deletions

View file

@ -953,14 +953,7 @@ static bool juggle(curl_socket_t *sockfdp,
FD_ZERO(&fds_write);
FD_ZERO(&fds_err);
#ifdef __DJGPP__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Warith-conversion"
#endif
FD_SET((curl_socket_t)fileno(stdin), &fds_read);
#ifdef __DJGPP__
#pragma GCC diagnostic pop
#endif
switch(*mode) {
@ -969,14 +962,7 @@ static bool juggle(curl_socket_t *sockfdp,
/* server mode */
sockfd = listenfd;
/* there is always a socket to wait for */
#ifdef __DJGPP__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Warith-conversion"
#endif
FD_SET(sockfd, &fds_read);
#ifdef __DJGPP__
#pragma GCC diagnostic pop
#endif
maxfd = (int)sockfd;
break;
@ -990,14 +976,7 @@ static bool juggle(curl_socket_t *sockfdp,
}
else {
/* there is always a socket to wait for */
#ifdef __DJGPP__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Warith-conversion"
#endif
FD_SET(sockfd, &fds_read);
#ifdef __DJGPP__
#pragma GCC diagnostic pop
#endif
maxfd = (int)sockfd;
}
break;
@ -1007,14 +986,7 @@ static bool juggle(curl_socket_t *sockfdp,
sockfd = *sockfdp;
/* sockfd turns CURL_SOCKET_BAD when our connection has been closed */
if(CURL_SOCKET_BAD != sockfd) {
#ifdef __DJGPP__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Warith-conversion"
#endif
FD_SET(sockfd, &fds_read);
#ifdef __DJGPP__
#pragma GCC diagnostic pop
#endif
maxfd = (int)sockfd;
}
else {