diff options
author | Andreas Sandberg <Andreas.Sandberg@ARM.com> | 2014-08-26 10:13:45 -0400 |
---|---|---|
committer | Andreas Sandberg <Andreas.Sandberg@ARM.com> | 2014-08-26 10:13:45 -0400 |
commit | 70176fecd1ff04f7b8957f3110497d758310b569 (patch) | |
tree | ec2f32ee03a8a43a31bcfedd164b1ec3ee229532 /src/arch | |
parent | f3e5fee74373d16849a58a80827c54c773aa05e2 (diff) | |
download | gem5-70176fecd1ff04f7b8957f3110497d758310b569.tar.xz |
base: Replace the internal varargs stuff with C++11 constructs
We currently use our own home-baked support for type-safe variadic
functions. This is confusing and somewhat limited (e.g., cprintf only
supports a limited number of arguments). This changeset converts all
uses of our internal varargs support to use C++11 variadic macros.
Diffstat (limited to 'src/arch')
-rw-r--r-- | src/arch/generic/debugfaults.hh | 5 | ||||
-rw-r--r-- | src/arch/x86/bios/intelmp.cc | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/arch/generic/debugfaults.hh b/src/arch/generic/debugfaults.hh index c42f87c25..fcfdfb9e1 100644 --- a/src/arch/generic/debugfaults.hh +++ b/src/arch/generic/debugfaults.hh @@ -112,8 +112,9 @@ template <int Func> class M5VarArgsFault : public M5DebugFault { public: - M5VarArgsFault(const std::string &format, CPRINTF_DECLARATION) : - M5DebugFault((DebugFunc)Func, csprintf(format, VARARGS_ALLARGS)) + template<typename ...Args> + M5VarArgsFault(const std::string &format, const Args &...args) : + M5DebugFault((DebugFunc)Func, csprintf(format, args...)) {} }; diff --git a/src/arch/x86/bios/intelmp.cc b/src/arch/x86/bios/intelmp.cc index 645c51b36..c907a63fe 100644 --- a/src/arch/x86/bios/intelmp.cc +++ b/src/arch/x86/bios/intelmp.cc @@ -92,7 +92,7 @@ writeOutString(PortProxy& proxy, Addr addr, string str, int length) if (str.length() > length) { memcpy(cleanedString, str.c_str(), length); warn("Intel MP configuration table string \"%s\" " - "will be truncated to \"%s\".\n", str, cleanedString); + "will be truncated to \"%s\".\n", str, (char *)&cleanedString); } else { memcpy(cleanedString, str.c_str(), str.length()); memset(cleanedString + str.length(), 0, length - str.length()); |