Gabe Black has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/35275 )

Change subject: base: Add some error handling to compiler.hh.
......................................................................

base: Add some error handling to compiler.hh.

Rather than just leaving some macros undefined if none of the scenarios
we checked for match, we should report an error so it's clear what
happened. Otherwise the places the macros are used will just not compile
properly, or worse will silently not work correctly.

Change-Id: Ie010d6b6d1b6a1496a45d9ebc0d75d1c804df12f
---
M src/base/compiler.hh
1 file changed, 4 insertions(+), 0 deletions(-)



diff --git a/src/base/compiler.hh b/src/base/compiler.hh
index ee9a224..ead1507 100644
--- a/src/base/compiler.hh
+++ b/src/base/compiler.hh
@@ -76,6 +76,8 @@
 // gcc and clang support a custom attribute which is essentially the same
 // thing.
 #  define M5_VAR_USED [[gnu::unused]]
+#else
+#  error "Don't know what to do for your compiler."
 #endif


@@ -106,6 +108,8 @@
 // we can't do that with direct substitution.
 #  define M5_LIKELY(cond) __builtin_expect(!!(cond), 1)
 #  define M5_UNLIKELY(cond) __builtin_expect(!!(cond), 0)
+#else
+#  error "Don't know what to do for your compiler."
 #endif

// When a member variable may be unused, mark it with M5_CLASS_VAR_USED. This

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/35275
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: Ie010d6b6d1b6a1496a45d9ebc0d75d1c804df12f
Gerrit-Change-Number: 35275
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <gabebl...@google.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to