From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53563) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bzFEG-0005id-02 for qemu-devel@nongnu.org; Tue, 25 Oct 2016 23:50:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bzFEB-00064E-57 for qemu-devel@nongnu.org; Tue, 25 Oct 2016 23:50:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40894) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1bzFEA-000647-WB for qemu-devel@nongnu.org; Tue, 25 Oct 2016 23:50:11 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E4D384AE84 for ; Wed, 26 Oct 2016 03:50:09 +0000 (UTC) From: Fam Zheng Date: Wed, 26 Oct 2016 11:50:06 +0800 Message-Id: <1477453806-21097-1-git-send-email-famz@redhat.com> Subject: [Qemu-devel] [PATCH v2] trace: Fix 'char **' compilation error in simple backend List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Eric Blake , Stefan Hajnoczi 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 --- v2: Fix typo in commit message and "yeah we'll be counting stars". [Eric] --- scripts/tracetool/backend/simple.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/tracetool/backend/simple.py b/scripts/tracetool/backend/simple.py index 9885e83..85f6102 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 -- 2.7.4