From c4b85d5f9854abeee6d1dbe15ae65a7a1aada6b2 Mon Sep 17 00:00:00 2001 From: Andreas Sandberg Date: Thu, 18 May 2017 15:11:23 +0100 Subject: base, sim, arch: Fix clang 5.0 warnings Compiling gem5 with recent version of clang (4 and 5) triggers warnings that are treated as errors: * Global templatized static functions result in a warning if they are not used. These should either be declared as static inline or without the static identifier to avoid the warning. * Some templatized classes contain static variables. The instantiated versions of these variables / templates need to be explicitly declared to avoid a compiler warning. Change-Id: Ie8261144836e94ebab7ea04ccccb90927672c257 Signed-off-by: Andreas Sandberg Reviewed-by: Curtis Dunham Reviewed-on: https://gem5-review.googlesource.com/3420 Reviewed-by: Jason Lowe-Power --- src/arch/mips/faults.hh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/arch/mips') diff --git a/src/arch/mips/faults.hh b/src/arch/mips/faults.hh index 1ec726d17..dcce764ca 100644 --- a/src/arch/mips/faults.hh +++ b/src/arch/mips/faults.hh @@ -303,6 +303,30 @@ class TlbModifiedFault : public TlbFault ExcCode code() const { return MipsFault::code(); } }; +/* + * Explicitly declare template static member variables to avoid warnings + * in some clang versions + */ +template<> MipsFaultBase::FaultVals MipsFault::vals; +template<> MipsFaultBase::FaultVals MipsFault::vals; +template<> MipsFaultBase::FaultVals MipsFault::vals; +template<> MipsFaultBase::FaultVals MipsFault::vals; +template<> MipsFaultBase::FaultVals MipsFault::vals; +template<> MipsFaultBase::FaultVals MipsFault::vals; +template<> MipsFaultBase::FaultVals MipsFault::vals; +template<> MipsFaultBase::FaultVals MipsFault::vals; +template<> MipsFaultBase::FaultVals MipsFault::vals; +template<> MipsFaultBase::FaultVals MipsFault::vals; +template<> MipsFaultBase::FaultVals MipsFault::vals; +template<> MipsFaultBase::FaultVals MipsFault::vals; +template<> MipsFaultBase::FaultVals MipsFault::vals; +template<> MipsFaultBase::FaultVals MipsFault::vals; +template<> MipsFaultBase::FaultVals MipsFault::vals; +template<> MipsFaultBase::FaultVals MipsFault::vals; +template<> MipsFaultBase::FaultVals MipsFault::vals; + + + } // namespace MipsISA #endif // __MIPS_FAULTS_HH__ -- cgit v1.2.3