From b51e58e50f23aa5f88d2e4259e82a488060f35ee Mon Sep 17 00:00:00 2001
From: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Date: Sat, 17 Jul 2010 14:49:30 +0000
Subject: [PATCH] Use __clang_version__ macro

Newer llvm/clang versions (since r102686) have a __clang_version__ macro
which can be used to print the exact clang version.

Fix a case where chip_to_probe was referenced twice via extern, once at
the function level and once in a global include file. Found by latest
clang.

Corresponding to flashrom svn r1087.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
---
 flashrom.c | 7 ++++++-
 w29ee011.c | 1 -
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/flashrom.c b/flashrom.c
index 6077ae7..2118bec 100644
--- a/flashrom.c
+++ b/flashrom.c
@@ -1305,7 +1305,12 @@ void print_sysinfo(void)
 #endif
 #endif
 #ifdef __clang__
-	msg_ginfo(" LLVM %i/clang %i, ", __llvm__, __clang__);
+	msg_ginfo(" LLVM Clang");
+#ifdef __clang_version__
+	msg_ginfo(" %s,", __clang_version__);
+#else
+	msg_ginfo(" unknown version (before r102686),");
+#endif
 #elif defined(__GNUC__)
 	msg_ginfo(" GCC");
 #ifdef __VERSION__
diff --git a/w29ee011.c b/w29ee011.c
index 6b88a1c..4fc8853 100644
--- a/w29ee011.c
+++ b/w29ee011.c
@@ -26,7 +26,6 @@ int probe_w29ee011(struct flashchip *flash)
 {
 	chipaddr bios = flash->virtual_memory;
 	uint8_t id1, id2;
-	extern char *chip_to_probe;
 
 	if (!chip_to_probe || strcmp(chip_to_probe, "W29EE011")) {
 		msg_cdbg("Probing disabled for Winbond W29EE011 because "
-- 
GitLab