aboutsummaryrefslogtreecommitdiffstats
path: root/dirmngr/dns.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2018-12-17 17:46:26 +0000
committerWerner Koch <[email protected]>2018-12-17 17:46:26 +0000
commit40c307fa8d0e813f2aa57806f25b8b0063cc2be3 (patch)
treed6c7a2210960419715ce115c357faecd0d821fcb /dirmngr/dns.c
parentcard: Suppress error message by agent_scd_cardlist. (diff)
downloadgnupg-40c307fa8d0e813f2aa57806f25b8b0063cc2be3.tar.gz
gnupg-40c307fa8d0e813f2aa57806f25b8b0063cc2be3.zip
Silence a few compiler warnings new with gcc 8.
* dirmngr/dns.c: Include gpgrt.h. Silence -Warray-bounds also gcc. * tools/gpg-pair-tool.c (command_respond): Init two vars to silence gcc. Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'dirmngr/dns.c')
-rw-r--r--dirmngr/dns.c17
1 files changed, 12 insertions, 5 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