Skip to contentSkip to conversation

trace/simple: Fix compiler warning for 32 bit hosts

PATCH Applied Stefan Weil 2 participants 2 messages Aug 13, 2012 – Aug 14, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 trace/simple: Fix compiler warning for 32 bit hosts

gcc complains when a 32 bit pointer is casted to a 64 bit integer.

Cc Stefan Hajnoczi <[email protected]>
---
 scripts/tracetool/backend/simple.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
scripts/tracetool/backend/simple.py +1 -1
index c7e47d6..e4b4a7f 100644
@@ -79,7 +79,7 @@ def c(events):
                        )
                 # pointer var (not string)
                 elif type_.endswith('*'):
-                    out('    trace_record_write_u64(&rec, (uint64_t)(uint64_t *)%(name)s);',
+                    out('    trace_record_write_u64(&rec, (uintptr_t)(uint64_t *)%(name)s);',
                         name = name,
                        )
                 # primitive data type
Signature · 1 line
1.7.0.4