about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMartin <pizzard@users.noreply.github.com>2019-08-23T18·45+0200
committerXiaoyi Zhang <zhangxy988@gmail.com>2019-08-23T18·45-0400
commit0302d1e5fa4fcdd1763b7d1bb3212943b1ae911d (patch)
tree4e43462da1e5504bd808a1d4fbc910a2d08c8144
parent262d74ba81b1fc4d71f459555cde8ecb39786d68 (diff)
supppress unused variable warning for gcc (#372)
gcc complains with: 
```
'stacktraces_enabler' defined but not used [-Wunused-variable] 
static int stacktraces_enabler = []() { 
```
-rw-r--r--absl/debugging/internal/stacktrace_generic-inl.inc3
1 files changed, 2 insertions, 1 deletions
diff --git a/absl/debugging/internal/stacktrace_generic-inl.inc b/absl/debugging/internal/stacktrace_generic-inl.inc
index 2e876fef96cf..81a49ef2e860 100644
--- a/absl/debugging/internal/stacktrace_generic-inl.inc
+++ b/absl/debugging/internal/stacktrace_generic-inl.inc
@@ -16,6 +16,7 @@
 #include <cstring>
 
 #include "absl/debugging/stacktrace.h"
+#include "absl/base/attributes.h"
 
 // Sometimes, we can try to get a stack trace from within a stack
 // trace, because we don't block signals inside this code (which would be too
@@ -35,7 +36,7 @@ static __thread int recursive = 0;
 static std::atomic<bool> disable_stacktraces(true);  // Disabled until healthy.
 // Waiting until static initializers run seems to be late enough.
 // This file is included into stacktrace.cc so this will only run once.
-static int stacktraces_enabler = []() {
+ABSL_ATTRIBUTE_UNUSED static int stacktraces_enabler = []() {
   void* unused_stack[1];
   // Force the first backtrace to happen early to get the one-time shared lib
   // loading (allocation) out of the way. After the first call it is much safer