From b7ffd640ec48ada93045f8c46fc65f823490819b Mon Sep 17 00:00:00 2001
From: Nikos Skalkotos <nskalkotos@myrmex-inc.com>
Date: Tue, 6 Nov 2018 14:01:13 +0200
Subject: [PATCH] Fix unknown pragma warning in gcc

Check if the compiler is clang before using clang only pragma statements.
---
 backward.hpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/backward.hpp b/backward.hpp
index 69d5dba..53eea4f 100644
--- a/backward.hpp
+++ b/backward.hpp
@@ -1250,8 +1250,10 @@ class TraceResolverLinuxImpl<trace_resolver_tag::libbfd>:
 			}
 		}
 
+#if defined(__clang__)
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant"
+#endif
 		if (!result.found && fobj.symtab) {
 			result.found = bfd_find_nearest_line(fobj.handle.get(), section,
 					fobj.symtab.get(), addr - sec_addr, &result.filename,
@@ -1263,7 +1265,9 @@ class TraceResolverLinuxImpl<trace_resolver_tag::libbfd>:
 					fobj.dynamic_symtab.get(), addr - sec_addr,
 					&result.filename, &result.funcname, &result.line);
 		}
+#if defined(__clang__)
 #pragma clang diagnostic pop
+#endif
 
 	}
 
