diff --git a/dirmngr/dns.c b/dirmngr/dns.c index 77f83f437..968fc3d7b 100644 --- a/dirmngr/dns.c +++ b/dirmngr/dns.c @@ -77,6 +77,7 @@ typedef int socket_fd_t; #include /* 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/tests/gpgscm/scheme.c b/tests/gpgscm/scheme.c index 4384841a7..b188e36ce 100644 --- a/tests/gpgscm/scheme.c +++ b/tests/gpgscm/scheme.c @@ -44,6 +44,8 @@ # endif #endif +#include "gpgrt.h" /* For GGPRT_GCC_VERSION */ + /* Used for documentation purposes, to signal functions in 'interface' */ #define INTERFACE @@ -3438,6 +3440,11 @@ int list_length(scheme *sc, pointer a) { +#if GPGRT_GCC_VERSION >= 80000 +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wimplicit-fallthrough" +#endif + #define s_retbool(tf) s_return(sc,(tf) ? sc->T : sc->F) /* kernel of this interpreter */ @@ -5323,6 +5330,11 @@ Eval_Cycle(scheme *sc, enum scheme_opcodes op) { } } +#if GPGRT_GCC_VERSION >= 80000 +# pragma GCC diagnostic pop +#endif + + typedef int (*test_predicate)(pointer); static int is_any(pointer p) {