From: Giacomo Travaglini Date: Thu, 25 Jun 2020 08:27:58 +0000 (+0100) Subject: sim: Fix -Werror=maybe-uninitialized in system.cc X-Git-Tag: v20.1.0.0~535 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2edcd3dbc82b68658a2e68070a92d053a2001c61;p=gem5.git sim: Fix -Werror=maybe-uninitialized in system.cc The patch is simply initializing when to 0 before unserializing the real value Change-Id: I4e19eeafa9334116b440948af1943f3835803671 Signed-off-by: Giacomo Travaglini Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30594 Tested-by: kokoro Reviewed-by: Daniel Carvalho Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power --- diff --git a/src/sim/system.cc b/src/sim/system.cc index 413341274..6e5975e9d 100644 --- a/src/sim/system.cc +++ b/src/sim/system.cc @@ -447,7 +447,7 @@ System::unserialize(CheckpointIn &cp) UNSERIALIZE_SCALAR(pagePtr); for (auto &t: threads.threads) { - Tick when; + Tick when = 0; ContextID id = t.context->contextId(); if (!optParamIn(cp, csprintf("quiesceEndTick_%d", id), when) || !when || !t.resumeEvent) {