misc: Appease GCC 8

GCC 8 adds a number of new warnings to -Wall which generate errors.

- Fix memset to 0 for structs by adding casts.
- Fix cast with const when the const was ignored.
- Fix catch a polymorphic type by value

We now compile with GCC 8!

Change-Id: Iab70ce11190eee67608fc25c0bedff170152b153
Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-on: https://gem5-review.googlesource.com/11949
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
This commit is contained in:
Jason Lowe-Power
2018-08-02 18:07:51 -07:00
parent 05f92d9760
commit 4fdfd98230
6 changed files with 13 additions and 5 deletions

View File

@@ -435,7 +435,7 @@ namespace BitfieldBackend
inline std::ostream &
bitfieldBackendPrinter(std::ostream &os, const char &t)
{
os << (const int)t;
os << (int)t;
return os;
}
@@ -443,7 +443,7 @@ namespace BitfieldBackend
inline std::ostream &
bitfieldBackendPrinter(std::ostream &os, const unsigned char &t)
{
os << (const unsigned int)t;
os << (unsigned int)t;
return os;
}
}