aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--dirmngr/dns.c17
-rw-r--r--tools/gpg-pair-tool.c4
2 files changed, 14 insertions, 7 deletions
diff --git a/dirmngr/dns.c b/dirmngr/dns.c
index 596e81fc9..210e9f49a 100644
--- a/dirmngr/dns.c
+++ b/dirmngr/dns.c
@@ -77,6 +77,7 @@ typedef int socket_fd_t;
#include <netdb.h> /* struct addrinfo */
#endif
+#include "gpgrt.h" /* For GGPRT_GCC_VERSION */
#include "dns.h"
@@ -7521,9 +7522,13 @@ static unsigned char *dns_so_tcp_recv_buffer(struct dns_socket *so) {
}
-#if defined __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Warray-bounds"
+
+#if GPGRT_GCC_VERSION >= 80000
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored "-Warray-bounds"
+#elif defined __clang__
+# pragma clang diagnostic push
+# pragma clang diagnostic ignored "-Warray-bounds"
#endif
static int dns_so_tcp_send(struct dns_socket *so) {
@@ -7589,8 +7594,10 @@ static int dns_so_tcp_recv(struct dns_socket *so) {
return 0;
} /* dns_so_tcp_recv() */
-#if __clang__
-#pragma clang diagnostic pop
+#if GPGRT_GCC_VERSION >= 80000
+# pragma GCC diagnostic pop
+#elif __clang__
+# pragma clang diagnostic pop
#endif
diff --git a/tools/gpg-pair-tool.c b/tools/gpg-pair-tool.c
index a86bd8e3c..347b29d24 100644
--- a/tools/gpg-pair-tool.c
+++ b/tools/gpg-pair-tool.c
@@ -1885,8 +1885,8 @@ command_respond (void)
{
gpg_error_t err;
unsigned char *msg;
- size_t msglen;
- int msgtype;
+ size_t msglen = 0; /* In case that read_message returns an error. */
+ int msgtype = 0; /* ditto. */
nvc_t state;
const char *rolestr;
const char *statestr;