From: Fam Zheng Date: Wed, 26 Oct 2016 03:50:06 +0000 (+0800) Subject: trace: Fix 'char **' compilation error in simple backend X-Git-Tag: v2.8.0-rc0~58 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=db4df20de86c6e8ecd6c9f042c029ffb9f9cddac;p=thirdparty%2Fqemu.git trace: Fix 'char **' compilation error in simple backend Currently, the generated function body will do "strlen(arg)" but the argument could be 'char **' or 'char * const *'. Avoid that by excluding such cases in is_string check. Reported by patchew's "make docker-test-mingw@fedora". Suggested-by: Eric Blake Signed-off-by: Fam Zheng Reviewed-by: Eric Blake Message-id: 1477453806-21097-1-git-send-email-famz@redhat.com Signed-off-by: Peter Maydell --- diff --git a/scripts/tracetool/backend/simple.py b/scripts/tracetool/backend/simple.py index 9885e83cd40..85f61028e23 100644 --- a/scripts/tracetool/backend/simple.py +++ b/scripts/tracetool/backend/simple.py @@ -21,7 +21,8 @@ PUBLIC = True def is_string(arg): strtype = ('const char*', 'char*', 'const char *', 'char *') - if arg.lstrip().startswith(strtype): + arg_strip = arg.lstrip() + if arg_strip.startswith(strtype) and arg_strip.count('*') == 1: return True else: return False