sparc: Fix a warning/error in tlb.cc.
authorGabe Black <gabeblack@google.com>
Thu, 12 Sep 2019 00:12:54 +0000 (17:12 -0700)
committerGabe Black <gabeblack@google.com>
Fri, 13 Sep 2019 00:55:25 +0000 (00:55 +0000)
gcc has started to not like memseting an ojbect to zero in some cases.
Cast the TlbEntry pointer to a void * before memsetting it to placate
gcc.

Change-Id: Iccb3c326fdb82f1f111329ff1a80bb6719cace47
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/20830
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Gabe Black <gabeblack@google.com>

src/arch/sparc/tlb.cc

index 8564c43996f681e0544a7d7488fb1d74dbd4eea1..e6e2c00ca0e4603a07e744e371bc5585650bfe4f 100644 (file)
@@ -61,7 +61,7 @@ TLB::TLB(const Params *p)
         fatal("SPARC T1 TLB registers don't support more than 64 TLB entries");
 
     tlb = new TlbEntry[size];
-    std::memset(tlb, 0, sizeof(TlbEntry) * size);
+    std::memset((void *)tlb, 0, sizeof(TlbEntry) * size);
 
     for (int x = 0; x < size; x++)
         freeList.push_back(&tlb[x]);