From: Andrea Mondelli Date: Fri, 15 Mar 2019 21:00:20 +0000 (-0400) Subject: mem-cache: tautological comparison of byteOrder X-Git-Tag: v19.0.0.0~1044 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0996afe2049e67d449557815af949caa79159e2e;p=gem5.git mem-cache: tautological comparison of byteOrder Error: build/X86/mem/cache/prefetch/indirect_memory.cc:56:24: error: result of comparison of constant -1 with expression of type 'const ByteOrder' is always false [-Werror,-Wtautological-constant-out-of-range-compare] fatal_if(byteOrder == -1, "This prefetcher requires a defined ISA\n"); ~~~~~~~~~ ^ ~~ build/X86/base/logging.hh:205:14: note: expanded from macro 'fatal_if' if ((cond)) { \ ^~~~ 1 error generated. Fix: cast of constant (-1) used in comparison Change-Id: I3deb154c2fe5b92c4ddf499176cb185c4ec7cf64 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17388 Reviewed-by: Nikos Nikoleris Reviewed-by: Daniel Carvalho Maintainer: Nikos Nikoleris --- diff --git a/src/mem/cache/prefetch/indirect_memory.cc b/src/mem/cache/prefetch/indirect_memory.cc index 41edfe0ab..393958c57 100644 --- a/src/mem/cache/prefetch/indirect_memory.cc +++ b/src/mem/cache/prefetch/indirect_memory.cc @@ -53,7 +53,8 @@ IndirectMemoryPrefetcher::IndirectMemoryPrefetcher( byteOrder((ByteOrder) -1) #endif { - fatal_if(byteOrder == -1, "This prefetcher requires a defined ISA\n"); + fatal_if(byteOrder == static_cast(-1), + "This prefetcher requires a defined ISA\n"); } void