summaryrefslogtreecommitdiff
path: root/src/base/misc.hh
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2006-11-22 15:45:32 -0500
committerGabe Black <gblack@eecs.umich.edu>2006-11-22 15:45:32 -0500
commit0a99750ebfe9a9b400ee5f0610ed429851345c4b (patch)
treeb73463f5330730cca540b0fb0bd3757353e88d1a /src/base/misc.hh
parent04e6a3a07b6fdaba9f0954971b61556078611a55 (diff)
parent719416b60ff2ab60403d22b6c7f75139b9535d8c (diff)
downloadgem5-0a99750ebfe9a9b400ee5f0610ed429851345c4b.tar.xz
Merge zizzer:/bk/sparcfs
into zower.eecs.umich.edu:/eecshome/m5/newmem --HG-- extra : convert_revision : 75f3398e38e18eb1f8248e23708d7a8d8cce0fc5
Diffstat (limited to 'src/base/misc.hh')
-rw-r--r--src/base/misc.hh13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/base/misc.hh b/src/base/misc.hh
index 87faf20e6..1c5720ce1 100644
--- a/src/base/misc.hh
+++ b/src/base/misc.hh
@@ -76,6 +76,19 @@ void __warn(const std::string&, cp::ArgList &, const char*, const char*, int);
#define warn(args...) \
__warn__(args, cp::ArgListNull())
+// Only print the warning message the first time it is seen. This
+// doesn't check the warning string itself, it just only lets one
+// warning come from the statement. So, even if the arguments change
+// and that would have resulted in a different warning message,
+// subsequent messages would still be supressed.
+#define warn_once(args...) do { \
+ static bool once = false; \
+ if (!once) { \
+ __warn__(args, cp::ArgListNull()); \
+ once = true; \
+ } \
+ } while (0)
+
//
// assert() that prints out the current cycle
//