summaryrefslogtreecommitdiff
path: root/src/base/cprintf.cc
diff options
context:
space:
mode:
authorJason Lowe-Power <jason@lowepower.com>2017-12-13 10:19:04 -0800
committerJason Lowe-Power <jason@lowepower.com>2017-12-14 00:27:59 +0000
commit5c41076bd7610d03431fd0dd89bd0fdc7f30d6bd (patch)
treeee24cdf5ea368fb808d0b6029313a163c375898b /src/base/cprintf.cc
parentf07d5069d86e31ecf195664850f79fb00c445bd3 (diff)
downloadgem5-5c41076bd7610d03431fd0dd89bd0fdc7f30d6bd.tar.xz
misc: Updates for gcc7.2 for x86
GCC 7.2 is much stricter than previous GCC versions. The following changes are needed: * There is now a warning if there is an implicit fallthrough between two case statments. C++17 adds the [[fallthrough]]; declaration. However, to support non C++17 standards (i.e., C++11), we use M5_FALLTHROUGH. M5_FALLTHROUGH checks for [[fallthrough]] compliant C++17 compiler and if that doesn't exist, it defaults to nothing (no older compilers generate warnings). * The above resulted in a couple of bugs that were found. This is noted in the review request on gerrit. * throw() for dynamic exception specification is deprecated * There were a couple of new uninitialized variable warnings * Can no longer perform bitwise operations on a bool. * Must now include <functional> for std::function * Compiler bug for void* lambda. Changed to auto as work around. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82878 Change-Id: I5d4c782a4e133fa4cdb119e35d9aff68c6e2958e Signed-off-by: Jason Lowe-Power <jason@lowepower.com> Reviewed-on: https://gem5-review.googlesource.com/5802 Reviewed-by: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src/base/cprintf.cc')
-rw-r--r--src/base/cprintf.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/base/cprintf.cc b/src/base/cprintf.cc
index 5daf196f1..caf1bb847 100644
--- a/src/base/cprintf.cc
+++ b/src/base/cprintf.cc
@@ -35,6 +35,8 @@
#include <iostream>
#include <sstream>
+#include "base/compiler.hh"
+
using namespace std;
namespace cp {
@@ -138,6 +140,7 @@ Print::process_flag()
case 'X':
fmt.uppercase = true;
+ M5_FALLTHROUGH;
case 'x':
fmt.base = Format::hex;
fmt.format = Format::integer;
@@ -159,6 +162,7 @@ Print::process_flag()
case 'G':
fmt.uppercase = true;
+ M5_FALLTHROUGH;
case 'g':
fmt.format = Format::floating;
fmt.float_format = Format::best;
@@ -167,6 +171,7 @@ Print::process_flag()
case 'E':
fmt.uppercase = true;
+ M5_FALLTHROUGH;
case 'e':
fmt.format = Format::floating;
fmt.float_format = Format::scientific;
@@ -213,6 +218,7 @@ Print::process_flag()
fmt.fill_zero = true;
break;
}
+ M5_FALLTHROUGH;
case '1':
case '2':
case '3':