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.
Tested on old and new clang.
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
Index: flashrom-clang_version/w29ee011.c =================================================================== --- flashrom-clang_version/w29ee011.c (Revision 1073) +++ flashrom-clang_version/w29ee011.c (Arbeitskopie) @@ -26,7 +26,6 @@ { 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 " Index: flashrom-clang_version/flashrom.c =================================================================== --- flashrom-clang_version/flashrom.c (Revision 1073) +++ flashrom-clang_version/flashrom.c (Arbeitskopie) @@ -1272,7 +1272,12 @@ #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__
On Mon, Jul 12, 2010 at 07:05:43PM +0200, Carl-Daniel Hailfinger wrote:
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.
Tested on old and new clang.
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
Acked-by: Uwe Hermann uwe@hermann-uwe.de
Looks good here, I tested with clang 2.6-3 from Debian unstable.
Before: flashrom v0.9.2-r1085 on Linux 2.6.32-5-amd64 (x86_64), built with libpci 3.1.7, LLVM 1/clang 1, little endian
After: flashrom v0.9.2-r1085 on Linux 2.6.32-5-amd64 (x86_64), built with libpci 3.1.7, LLVM Clang unknown version (before r102686), little endian
Uwe.
On 17.07.2010 15:53, Uwe Hermann wrote:
On Mon, Jul 12, 2010 at 07:05:43PM +0200, Carl-Daniel Hailfinger wrote:
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.
Tested on old and new clang.
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
Acked-by: Uwe Hermann uwe@hermann-uwe.de
Looks good here, I tested with clang 2.6-3 from Debian unstable.
Before: flashrom v0.9.2-r1085 on Linux 2.6.32-5-amd64 (x86_64), built with libpci 3.1.7, LLVM 1/clang 1, little endian
After: flashrom v0.9.2-r1085 on Linux 2.6.32-5-amd64 (x86_64), built with libpci 3.1.7, LLVM Clang unknown version (before r102686), little endian
Yes, clang support for version numbers started shortly after llvm 2.7. Before that, there was no version number available at all.
Thanks, committed in r1087.
Regards, Carl-Daniel