From 2569c4fc94f303b04c75692fd8977a28e278bae9 Mon Sep 17 00:00:00 2001 From: Julian Seward Date: Mon, 11 Oct 2010 19:15:33 +0000 Subject: [PATCH] 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. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11429 --- coregrind/m_debuginfo/readdwarf3.c | 9 --------- coregrind/m_replacemalloc/vg_replace_malloc.c | 2 +- coregrind/vg_preloaded.c | 2 +- 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/coregrind/m_debuginfo/readdwarf3.c b/coregrind/m_debuginfo/readdwarf3.c index c358a1bbe9..b2fb1a74e4 100644 --- a/coregrind/m_debuginfo/readdwarf3.c +++ b/coregrind/m_debuginfo/readdwarf3.c @@ -220,15 +220,6 @@ static UChar* get_address_of_Cursor ( Cursor* c ) { 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 ) { diff --git a/coregrind/m_replacemalloc/vg_replace_malloc.c b/coregrind/m_replacemalloc/vg_replace_malloc.c index b861e06dd9..95756d24e0 100644 --- a/coregrind/m_replacemalloc/vg_replace_malloc.c +++ b/coregrind/m_replacemalloc/vg_replace_malloc.c @@ -747,7 +747,7 @@ static void panic(const char *str) { 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) \ diff --git a/coregrind/vg_preloaded.c b/coregrind/vg_preloaded.c index f37299a615..f74b52af92 100644 --- a/coregrind/vg_preloaded.c +++ b/coregrind/vg_preloaded.c @@ -65,7 +65,7 @@ void VG_NOTIFY_ON_LOAD(freeres)( void ) VG_USERREQ__LIBC_FREERES_DONE, 0, 0, 0, 0, 0); /*NOTREACHED*/ - *(int *)0 = 'x'; + *(volatile int *)0 = 'x'; } /* --------------------------------------------------------------------- -- 2.47.2