summaryrefslogtreecommitdiff
path: root/usr
diff options
context:
space:
mode:
Diffstat (limited to 'usr')
-rw-r--r--usr/src/uts/common/sys/ccompile.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/usr/src/uts/common/sys/ccompile.h b/usr/src/uts/common/sys/ccompile.h
index e687fd99a3..94f7c9707b 100644
--- a/usr/src/uts/common/sys/ccompile.h
+++ b/usr/src/uts/common/sys/ccompile.h
@@ -158,6 +158,16 @@ extern "C" {
#define __packed __attribute__((__packed__))
#define __section(x) __attribute__((__section__(x)))
#define __unused __sun_attr__((__unused__))
+#ifdef DEBUG
+/* We want to discover unused variables in DEBUG build. */
+#define __maybe_unused
+#else
+/*
+ * In release build, disable warnings about variables
+ * which are used only for debugging.
+ */
+#define __maybe_unused __sun_attr__((__unused__))
+#endif
#define __used __attribute__((__used__))
#define __weak_symbol __attribute__((__weak__))
#define __HIDDEN __attribute__((visibility("hidden")))