--- src/session.c~	2024-10-16 10:03:21.000000000 +0200
+++ src/session.c	2024-10-19 15:24:17.000000000 +0200
@@ -568,9 +568,6 @@
 #pragma warning(disable:4054)
 /* 'type cast': from function pointer to data pointer */
 #pragma warning(disable:4055)
-#else
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wpedantic"
 #endif
 LIBSSH2_API void *
 libssh2_session_callback_set(LIBSSH2_SESSION * session,
@@ -581,8 +578,6 @@
 }
 #ifdef _MSC_VER
 #pragma warning(pop)
-#else
-#pragma GCC diagnostic pop
 #endif
 
 /*
@@ -675,27 +670,13 @@
 
         if(dir & LIBSSH2_SESSION_BLOCK_INBOUND) {
             FD_ZERO(&rfd);
-#if defined(__GNUC__)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wsign-conversion"
-#endif
             FD_SET(session->socket_fd, &rfd);
-#if defined(__GNUC__)
-#pragma GCC diagnostic pop
-#endif
             readfd = &rfd;
         }
 
         if(dir & LIBSSH2_SESSION_BLOCK_OUTBOUND) {
             FD_ZERO(&wfd);
-#if defined(__GNUC__)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wsign-conversion"
-#endif
             FD_SET(session->socket_fd, &wfd);
-#if defined(__GNUC__)
-#pragma GCC diagnostic pop
-#endif
             writefd = &wfd;
         }
 
@@ -1655,40 +1636,19 @@
         switch(fds[i].type) {
         case LIBSSH2_POLLFD_SOCKET:
             if(fds[i].events & LIBSSH2_POLLFD_POLLIN) {
-#if defined(__GNUC__)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wsign-conversion"
-#endif
                 FD_SET(fds[i].fd.socket, &rfds);
-#if defined(__GNUC__)
-#pragma GCC diagnostic pop
-#endif
                 if(fds[i].fd.socket > maxfd)
                     maxfd = fds[i].fd.socket;
             }
             if(fds[i].events & LIBSSH2_POLLFD_POLLOUT) {
-#if defined(__GNUC__)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wsign-conversion"
-#endif
                 FD_SET(fds[i].fd.socket, &wfds);
-#if defined(__GNUC__)
-#pragma GCC diagnostic pop
-#endif
                 if(fds[i].fd.socket > maxfd)
                     maxfd = fds[i].fd.socket;
             }
             break;
 
         case LIBSSH2_POLLFD_CHANNEL:
-#if defined(__GNUC__)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wsign-conversion"
-#endif
             FD_SET(fds[i].fd.channel->session->socket_fd, &rfds);
-#if defined(__GNUC__)
-#pragma GCC diagnostic pop
-#endif
             if(fds[i].fd.channel->session->socket_fd > maxfd)
                 maxfd = fds[i].fd.channel->session->socket_fd;
             if(!session)
@@ -1696,14 +1656,7 @@
             break;
 
         case LIBSSH2_POLLFD_LISTENER:
-#if defined(__GNUC__)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wsign-conversion"
-#endif
             FD_SET(fds[i].fd.listener->session->socket_fd, &rfds);
-#if defined(__GNUC__)
-#pragma GCC diagnostic pop
-#endif
             if(fds[i].fd.listener->session->socket_fd > maxfd)
                 maxfd = fds[i].fd.listener->session->socket_fd;
             if(!session)
@@ -1880,10 +1833,6 @@
             for(i = 0; i < nfds; i++) {
                 switch(fds[i].type) {
                 case LIBSSH2_POLLFD_SOCKET:
-#if defined(__GNUC__)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wsign-conversion"
-#endif
                     if(FD_ISSET(fds[i].fd.socket, &rfds)) {
                         fds[i].revents |= LIBSSH2_POLLFD_POLLIN;
                     }
@@ -1893,9 +1842,6 @@
                     if(fds[i].revents) {
                         active_fds++;
                     }
-#if defined(__GNUC__)
-#pragma GCC diagnostic pop
-#endif
                     break;
 
                 case LIBSSH2_POLLFD_CHANNEL:
--- example/direct_tcpip.c~	2024-10-16 10:03:21.000000000 +0200
+++ example/direct_tcpip.c	2024-10-19 15:41:52.000000000 +0200
@@ -248,14 +248,7 @@
     for(;;) {
         fd_set fds;
         FD_ZERO(&fds);
-#if defined(__GNUC__)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wsign-conversion"
-#endif
         FD_SET(forwardsock, &fds);
-#if defined(__GNUC__)
-#pragma GCC diagnostic pop
-#endif
         tv.tv_sec = 0;
         tv.tv_usec = 100000;
         rc = select((int)(forwardsock + 1), &fds, NULL, NULL, &tv);
@@ -263,14 +256,7 @@
             fprintf(stderr, "failed to select().\n");
             goto shutdown;
         }
-#if defined(__GNUC__)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wsign-conversion"
-#endif
         if(rc && FD_ISSET(forwardsock, &fds)) {
-#if defined(__GNUC__)
-#pragma GCC diagnostic pop
-#endif
             len = recv(forwardsock, buf, sizeof(buf), 0);
             if(len < 0) {
                 fprintf(stderr, "failed to recv().\n");
--- example/scp_nonblock.c~	2024-10-16 10:03:21.000000000 +0200
+++ example/scp_nonblock.c	2024-10-19 15:56:28.000000000 +0200
@@ -64,14 +64,7 @@
 
     FD_ZERO(&fd);
 
-#if defined(__GNUC__)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wsign-conversion"
-#endif
     FD_SET(socket_fd, &fd);
-#if defined(__GNUC__)
-#pragma GCC diagnostic pop
-#endif
 
     /* now make sure we wait in the correct direction */
     dir = libssh2_session_block_directions(session);
--- example/sftp_write_nonblock.c~	2024-10-16 10:03:21.000000000 +0200
+++ example/sftp_write_nonblock.c	2024-10-19 16:03:48.000000000 +0200
@@ -54,14 +54,7 @@
 
     FD_ZERO(&fd);
 
-#if defined(__GNUC__)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wsign-conversion"
-#endif
     FD_SET(socket_fd, &fd);
-#if defined(__GNUC__)
-#pragma GCC diagnostic pop
-#endif
 
     /* now make sure we wait in the correct direction */
     dir = libssh2_session_block_directions(session);
--- example/scp_write_nonblock.c~	2024-10-16 10:03:21.000000000 +0200
+++ example/scp_write_nonblock.c	2024-10-19 16:12:37.000000000 +0200
@@ -48,14 +48,7 @@
 
     FD_ZERO(&fd);
 
-#if defined(__GNUC__)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wsign-conversion"
-#endif
     FD_SET(socket_fd, &fd);
-#if defined(__GNUC__)
-#pragma GCC diagnostic pop
-#endif
 
     /* now make sure we wait in the correct direction */
     dir = libssh2_session_block_directions(session);
--- example/sftp_RW_nonblock.c~	2024-10-16 10:03:21.000000000 +0200
+++ example/sftp_RW_nonblock.c	2024-10-19 16:20:21.000000000 +0200
@@ -56,14 +56,7 @@
 
     FD_ZERO(&fd);
 
-#if defined(__GNUC__)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wsign-conversion"
-#endif
     FD_SET(socket_fd, &fd);
-#if defined(__GNUC__)
-#pragma GCC diagnostic pop
-#endif
 
     /* now make sure we wait in the correct direction */
     dir = libssh2_session_block_directions(session);
@@ -258,15 +251,8 @@
 
         FD_ZERO(&fd);
         FD_ZERO(&fd2);
-#if defined(__GNUC__)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wsign-conversion"
-#endif
         FD_SET(sock, &fd);
         FD_SET(sock, &fd2);
-#if defined(__GNUC__)
-#pragma GCC diagnostic pop
-#endif
 
         /* wait for readable or writeable */
         rc = select((int)(sock + 1), &fd, &fd2, NULL, &timeout);
@@ -329,15 +315,8 @@
 
             FD_ZERO(&fd);
             FD_ZERO(&fd2);
-#if defined(__GNUC__)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wsign-conversion"
-#endif
             FD_SET(sock, &fd);
             FD_SET(sock, &fd2);
-#if defined(__GNUC__)
-#pragma GCC diagnostic pop
-#endif
 
             /* wait for readable or writeable */
             rc = select((int)(sock + 1), &fd, &fd2, NULL, &timeout);
--- example/sftp_nonblock.c~	2024-10-16 10:03:21.000000000 +0200
+++ example/sftp_nonblock.c	2024-10-19 16:28:42.000000000 +0200
@@ -65,14 +65,7 @@
 
     FD_ZERO(&fd);
 
-#if defined(__GNUC__)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wsign-conversion"
-#endif
     FD_SET(socket_fd, &fd);
-#if defined(__GNUC__)
-#pragma GCC diagnostic pop
-#endif
 
     /* now make sure we wait in the correct direction */
     dir = libssh2_session_block_directions(session);
--- example/sftp_write_sliding.c~	2024-10-16 10:03:21.000000000 +0200
+++ example/sftp_write_sliding.c	2024-10-19 16:34:06.000000000 +0200
@@ -55,14 +55,7 @@
 
     FD_ZERO(&fd);
 
-#if defined(__GNUC__)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wsign-conversion"
-#endif
     FD_SET(socket_fd, &fd);
-#if defined(__GNUC__)
-#pragma GCC diagnostic pop
-#endif
 
     /* now make sure we wait in the correct direction */
     dir = libssh2_session_block_directions(session);
--- example/ssh2_agent_forwarding.c~	2024-10-16 10:03:21.000000000 +0200
+++ example/ssh2_agent_forwarding.c	2024-10-19 16:41:27.000000000 +0200
@@ -50,14 +50,7 @@
 
     FD_ZERO(&fd);
 
-#if defined(__GNUC__)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wsign-conversion"
-#endif
     FD_SET(socket_fd, &fd);
-#if defined(__GNUC__)
-#pragma GCC diagnostic pop
-#endif
 
     /* now make sure we wait in the correct direction */
     dir = libssh2_session_block_directions(session);
--- example/ssh2_echo.c~	2024-10-16 10:03:21.000000000 +0200
+++ example/ssh2_echo.c	2024-10-19 16:48:51.000000000 +0200
@@ -47,14 +47,7 @@
 
     FD_ZERO(&fd);
 
-#if defined(__GNUC__)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wsign-conversion"
-#endif
     FD_SET(socket_fd, &fd);
-#if defined(__GNUC__)
-#pragma GCC diagnostic pop
-#endif
 
     /* now make sure we wait in the correct direction */
     dir = libssh2_session_block_directions(session);
--- example/ssh2_exec.c~	2024-10-16 10:03:21.000000000 +0200
+++ example/ssh2_exec.c	2024-10-19 16:56:52.000000000 +0200
@@ -51,14 +51,7 @@
 
     FD_ZERO(&fd);
 
-#if defined(__GNUC__)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wsign-conversion"
-#endif
     FD_SET(socket_fd, &fd);
-#if defined(__GNUC__)
-#pragma GCC diagnostic pop
-#endif
 
     /* now make sure we wait in the correct direction */
     dir = libssh2_session_block_directions(session);
--- example/tcpip-forward.c~	2024-10-16 10:03:21.000000000 +0200
+++ example/tcpip-forward.c	2024-10-19 17:07:21.000000000 +0200
@@ -246,14 +246,7 @@
     for(;;) {
         fd_set fds;
         FD_ZERO(&fds);
-#if defined(__GNUC__)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wsign-conversion"
-#endif
         FD_SET(forwardsock, &fds);
-#if defined(__GNUC__)
-#pragma GCC diagnostic pop
-#endif
         tv.tv_sec = 0;
         tv.tv_usec = 100000;
         rc = select((int)(forwardsock + 1), &fds, NULL, NULL, &tv);
@@ -261,14 +254,7 @@
             fprintf(stderr, "failed to select().\n");
             goto shutdown;
         }
-#if defined(__GNUC__)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wsign-conversion"
-#endif
         if(rc && FD_ISSET(forwardsock, &fds)) {
-#if defined(__GNUC__)
-#pragma GCC diagnostic pop
-#endif
             ssize_t nwritten;
             len = recv(forwardsock, buf, sizeof(buf), 0);
             if(len < 0) {
--- example/x11.c~	2024-10-16 10:03:21.000000000 +0200
+++ example/x11.c	2024-10-19 17:12:52.000000000 +0200
@@ -210,14 +210,7 @@
     timeval_out.tv_usec = 0;
 
     FD_ZERO(&set);
-#if defined(__GNUC__)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wsign-conversion"
-#endif
     FD_SET(sock, &set);
-#if defined(__GNUC__)
-#pragma GCC diagnostic pop
-#endif
 
     buf = calloc(bufsize, sizeof(char));
     if(!buf)
@@ -415,14 +408,7 @@
     for(;;) {
 
         FD_ZERO(&set);
-#if defined(__GNUC__)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wsign-conversion"
-#endif
         FD_SET(fileno(stdin), &set);
-#if defined(__GNUC__)
-#pragma GCC diagnostic pop
-#endif
 
         /* Search if a resize pty has to be send */
         ioctl(fileno(stdin), TIOCGWINSZ, &w_size);
