Blame 0001-GCC9-compatibility.patch

98fdd07
From 47a8fd8210deb317d37dd3b5f7d91abafc8376e0 Mon Sep 17 00:00:00 2001
98fdd07
From: Tomas Krizek <tomas.krizek@nic.cz>
98fdd07
Date: Thu, 4 Apr 2019 16:15:47 +0200
98fdd07
Subject: [PATCH] GCC9 compatibility
98fdd07
98fdd07
---
98fdd07
 src/lib/dns.h | 19 +------------------
98fdd07
 1 file changed, 1 insertion(+), 18 deletions(-)
98fdd07
98fdd07
diff --git a/src/lib/dns.h b/src/lib/dns.h
98fdd07
index 78d6402..f6ce1d6 100644
98fdd07
--- a/src/lib/dns.h
98fdd07
+++ b/src/lib/dns.h
98fdd07
@@ -149,27 +149,10 @@ DNS_PUBLIC int *dns_debug_p(void);
98fdd07
  *
98fdd07
  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
98fdd07
 
98fdd07
-#if defined __clang__
98fdd07
-#define DNS_PRAGMA_PUSH _Pragma("clang diagnostic push")
98fdd07
-#define DNS_PRAGMA_QUIET _Pragma("clang diagnostic ignored \"-Winitializer-overrides\"")
98fdd07
-#define DNS_PRAGMA_POP _Pragma("clang diagnostic pop")
98fdd07
-
98fdd07
-#define dns_quietinit(...) \
98fdd07
-	DNS_PRAGMA_PUSH DNS_PRAGMA_QUIET __VA_ARGS__ DNS_PRAGMA_POP
98fdd07
-#elif (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) || __GNUC__ > 4
98fdd07
-#define DNS_PRAGMA_PUSH _Pragma("GCC diagnostic push")
98fdd07
-#define DNS_PRAGMA_QUIET _Pragma("GCC diagnostic ignored \"-Woverride-init\"")
98fdd07
-#define DNS_PRAGMA_POP _Pragma("GCC diagnostic pop")
98fdd07
-
98fdd07
-/* GCC parses the _Pragma operator less elegantly than clang. */
98fdd07
-#define dns_quietinit(...) \
98fdd07
-	__extension__ ({ DNS_PRAGMA_PUSH DNS_PRAGMA_QUIET __VA_ARGS__; DNS_PRAGMA_POP })
98fdd07
-#else
98fdd07
 #define DNS_PRAGMA_PUSH
98fdd07
 #define DNS_PRAGMA_QUIET
98fdd07
 #define DNS_PRAGMA_POP
98fdd07
 #define dns_quietinit(...) __VA_ARGS__
98fdd07
-#endif
98fdd07
 
98fdd07
 #if defined __GNUC__
98fdd07
 #define DNS_PRAGMA_EXTENSION __extension__
98fdd07
@@ -1056,7 +1039,7 @@ DNS_PUBLIC void dns_cache_close(struct dns_cache *);
98fdd07
 #define DNS_OPTS_INITIALIZER  { DNS_OPTS_INITIALIZER_ }
98fdd07
 #define DNS_OPTS_INIT(...)    { DNS_OPTS_INITIALIZER_, __VA_ARGS__ }
98fdd07
 
98fdd07
-#define dns_opts(...) (&dns_quietinit((struct dns_options)DNS_OPTS_INIT(__VA_ARGS__)))
98fdd07
+#define dns_opts(...) (&(struct dns_options){ __VA_ARGS__ })
98fdd07
 
98fdd07
 struct dns_options {
98fdd07
 	/*
98fdd07
-- 
98fdd07
2.21.0
98fdd07