|
From: <sv...@va...> - 2010-10-11 19:15:41
|
Author: sewardj
Date: 2010-10-11 20:15:33 +0100 (Mon, 11 Oct 2010)
New Revision: 11429
Log:
Remove some fluff detected by llvm-2.8 (clang):
- "*(int *)0 = " is apparently ignored by LLVM for who-knows-why
reason. Cast the zero to a volatile int * instead.
- remove an unused function that gcc failed to mention was unused
(why? because it was marked __attribute__((noreturn)) ?)
As an aside, clang/llvm-2.8 seemed to be able to successfully
compile Valgrind.
Modified:
trunk/coregrind/m_debuginfo/readdwarf3.c
trunk/coregrind/m_replacemalloc/vg_replace_malloc.c
trunk/coregrind/vg_preloaded.c
Modified: trunk/coregrind/m_debuginfo/readdwarf3.c
===================================================================
--- trunk/coregrind/m_debuginfo/readdwarf3.c 2010-10-11 19:09:53 UTC (rev 11428)
+++ trunk/coregrind/m_debuginfo/readdwarf3.c 2010-10-11 19:15:33 UTC (rev 11429)
@@ -220,15 +220,6 @@
return &c->region_start_img[ c->region_next ];
}
-__attribute__((noreturn))
-static void failWith ( Cursor* c, HChar* str ) {
- vg_assert(c);
- vg_assert(c->barf);
- c->barf(str);
- /*NOTREACHED*/
- vg_assert(0);
-}
-
/* FIXME: document assumptions on endianness for
get_UShort/UInt/ULong. */
static inline UChar get_UChar ( Cursor* c ) {
Modified: trunk/coregrind/m_replacemalloc/vg_replace_malloc.c
===================================================================
--- trunk/coregrind/m_replacemalloc/vg_replace_malloc.c 2010-10-11 19:09:53 UTC (rev 11428)
+++ trunk/coregrind/m_replacemalloc/vg_replace_malloc.c 2010-10-11 19:15:33 UTC (rev 11429)
@@ -747,7 +747,7 @@
{
VALGRIND_PRINTF_BACKTRACE("Program aborting because of call to %s\n", str);
_exit(99);
- *(int *)0 = 'x';
+ *(volatile int *)0 = 'x';
}
#define PANIC(soname, fnname) \
Modified: trunk/coregrind/vg_preloaded.c
===================================================================
--- trunk/coregrind/vg_preloaded.c 2010-10-11 19:09:53 UTC (rev 11428)
+++ trunk/coregrind/vg_preloaded.c 2010-10-11 19:15:33 UTC (rev 11429)
@@ -65,7 +65,7 @@
VG_USERREQ__LIBC_FREERES_DONE,
0, 0, 0, 0, 0);
/*NOTREACHED*/
- *(int *)0 = 'x';
+ *(volatile int *)0 = 'x';
}
/* ---------------------------------------------------------------------
|