]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Avoid strange warnings about dereferencing type-punned pointers that occurs
authorNicholas Nethercote <n.nethercote@gmail.com>
Mon, 25 Oct 2004 19:46:07 +0000 (19:46 +0000)
committerNicholas Nethercote <n.nethercote@gmail.com>
Mon, 25 Oct 2004 19:46:07 +0000 (19:46 +0000)
with GCC 3.3+.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2839

memcheck/mac_malloc_wrappers.c
memcheck/mc_clientreqs.c

index 8ac92ac9ff05bf2cbf7ae070f1516e3b7809e93d..0723693c4a2ad6c4713cf7dcca27d104eaa36e80 100644 (file)
@@ -290,7 +290,7 @@ void MAC_(handle_free) ( Addr p, UInt rzB, MAC_AllocKind kind )
    cmalloc_n_frees++;
 
    mc = (MAC_Chunk*)VG_(HT_get_node) ( MAC_(malloc_list), (UInt)p,
-                                       (VgHashNode***)&prev_chunks_next_ptr );
+                                       (void*)&prev_chunks_next_ptr );
    if (mc == NULL) {
       MAC_(record_free_error) ( tid, p );
       VGP_POPCC(VgpCliMalloc);
@@ -342,7 +342,7 @@ void* SK_(realloc) ( void* p, Int new_size )
 
    /* First try and find the block. */
    mc = (MAC_Chunk*)VG_(HT_get_node) ( MAC_(malloc_list), (UInt)p,
-                                       (VgHashNode***)&prev_chunks_next_ptr );
+                                       (void*)&prev_chunks_next_ptr );
 
    if (mc == NULL) {
       MAC_(record_free_error) ( tid, (Addr)p );
@@ -449,7 +449,7 @@ void MAC_(destroy_mempool)(Addr pool)
 
    mp = (MAC_Mempool*)VG_(HT_get_node) ( MAC_(mempool_list),
                                          (UInt)pool,
-                                         (VgHashNode***)&prev_next );
+                                         (void*)&prev_next );
 
    if (mp == NULL) {
       ThreadId      tid = VG_(get_current_or_recent_tid)();
@@ -471,7 +471,7 @@ void MAC_(mempool_alloc)(Addr pool, Addr addr, UInt size)
    MAC_Mempool** prev_next;
 
    mp = (MAC_Mempool*)VG_(HT_get_node) ( MAC_(mempool_list), (UInt)pool,
-                                        (VgHashNode***)&prev_next );
+                                        (void*)&prev_next );
 
    if (mp == NULL) {
       ThreadId      tid = VG_(get_current_or_recent_tid)();
@@ -494,7 +494,7 @@ void MAC_(mempool_free)(Addr pool, Addr addr)
 
 
    mp = (MAC_Mempool*)VG_(HT_get_node)(MAC_(mempool_list), (UInt)pool,
-                                       (VgHashNode***)&prev_pool);
+                                       (void*)&prev_pool);
 
    if (mp == NULL) {
       MAC_(record_illegal_mempool_error)(tid, pool);
@@ -502,7 +502,7 @@ void MAC_(mempool_free)(Addr pool, Addr addr)
    }
 
    mc = (MAC_Chunk*)VG_(HT_get_node)(mp->chunks, (UInt)addr,
-                                     (VgHashNode***)&prev_chunk);
+                                     (void*)&prev_chunk);
 
    if (mc == NULL) {
       MAC_(record_free_error)(tid, (Addr)addr);
index 65b5f650fc8868220df1490b826e9774869119d3..5f6df2e2811d7988b1b50dfe0200a6b968d88209 100644 (file)
@@ -147,7 +147,7 @@ Bool MC_(client_perm_maybe_describe)( Addr a, AddrInfo* ai )
          /* OK - maybe it's a mempool, too? */
          mp = (MAC_Mempool*)VG_(HT_get_node)(MAC_(mempool_list),
                                              (UInt)vg_cgbs[i].start,
-                                             (VgHashNode***)&d);
+                                             (void*)&d);
          if(mp != NULL) {
             if(mp->chunks != NULL) {
                MAC_Chunk *mc;