]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Remove some fluff detected by llvm-2.8 (clang):
authorJulian Seward <jseward@acm.org>
Mon, 11 Oct 2010 19:15:33 +0000 (19:15 +0000)
committerJulian Seward <jseward@acm.org>
Mon, 11 Oct 2010 19:15:33 +0000 (19:15 +0000)
- "*(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
coregrind/m_replacemalloc/vg_replace_malloc.c
coregrind/vg_preloaded.c

index c358a1bbe9f981bad9e6e4f53ddfa844c173ebff..b2fb1a74e4277a7002590850082f288b7ef88241 100644 (file)
@@ -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 ) {
index b861e06dd9619d6fc899374b3f581b231f6d6864..95756d24e0d17efb6ca409654375fb4ce4147d56 100644 (file)
@@ -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) \
index f37299a6151bec7135aeb95950c7764c4984ee55..f74b52af925e5b88a53ac4454712536abf1f72dd 100644 (file)
@@ -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';
 }
 
 /* ---------------------------------------------------------------------