qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] trace: Fix 'char **' compilation error in simple backend
@ 2016-10-26  1:59 Fam Zheng
  2016-10-26  2:29 ` Eric Blake
  0 siblings, 1 reply; 5+ messages in thread
From: Fam Zheng @ 2016-10-26  1:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: Stefan Hajnoczi

Currently, the generated function body will do "strlen(arg)" but the
argument could be 'char **'. Avoid that by exclusding such cases in
is_string check.

Reported by patchew's "make docker-test-mingw@fedora".

Signed-off-by: Fam Zheng <famz@redhat.com>
---
 scripts/tracetool/backend/simple.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/scripts/tracetool/backend/simple.py b/scripts/tracetool/backend/simple.py
index 9885e83..2538795 100644
--- a/scripts/tracetool/backend/simple.py
+++ b/scripts/tracetool/backend/simple.py
@@ -21,7 +21,9 @@ PUBLIC = True
 
 def is_string(arg):
     strtype = ('const char*', 'char*', 'const char *', 'char *')
-    if arg.lstrip().startswith(strtype):
+    non_strtype = ('const char**', 'char**', 'const char **', 'char **')
+    arg_strip = arg.lstrip()
+    if arg_strip.startswith(strtype) and not arg_strip.startswith(non_strtype):
         return True
     else:
         return False
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-10-26  3:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-26  1:59 [Qemu-devel] [PATCH] trace: Fix 'char **' compilation error in simple backend Fam Zheng
2016-10-26  2:29 ` Eric Blake
2016-10-26  2:46   ` Fam Zheng
2016-10-26  2:56     ` Eric Blake
2016-10-26  3:05       ` Fam Zheng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).