From 0996afe2049e67d449557815af949caa79159e2e Mon Sep 17 00:00:00 2001 From: Andrea Mondelli <Andrea.Mondelli@ucf.edu> Date: Fri, 15 Mar 2019 17:00:20 -0400 Subject: [PATCH] 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 <nikos.nikoleris@arm.com> Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br> Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com> --- src/mem/cache/prefetch/indirect_memory.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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<ByteOrder>(-1), + "This prefetcher requires a defined ISA\n"); } void -- 2.30.2