[ovs-dev] [PATCH 2/3] backtrace: Avoid GCC warning on x86-64.
Ben Pfaff
blp at nicira.com
Fri Nov 6 18:50:37 UTC 2009
The portable implementation of stack_low(), which before this commit is
used on x86-64, provokes a warning from GCC that cannot be disabled. We
already have an i386-specific implementation that does not warn; this
commit adds a corresponding implementation for x86-64 to avoid the warning
there too.
---
lib/backtrace.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/lib/backtrace.c b/lib/backtrace.c
index 42ab8c4..2f47809 100644
--- a/lib/backtrace.c
+++ b/lib/backtrace.c
@@ -73,6 +73,10 @@ stack_low(void)
uintptr_t low;
asm("movl %%esp,%0" : "=g" (low));
return low;
+#elif __x86_64__
+ uintptr_t low;
+ asm("movq %%rsp,%0" : "=g" (low));
+ return low;
#else
/* This causes a warning in GCC that cannot be disabled, so use it only on
* non-x86. */
--
1.6.3.3
More information about the dev
mailing list