From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34294) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WMwm9-000727-2v for qemu-devel@nongnu.org; Mon, 10 Mar 2014 05:45:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WMwlz-00066q-7I for qemu-devel@nongnu.org; Mon, 10 Mar 2014 05:45:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:27737) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WMwly-00066m-Te for qemu-devel@nongnu.org; Mon, 10 Mar 2014 05:45:27 -0400 From: Markus Armbruster References: Date: Mon, 10 Mar 2014 10:45:15 +0100 In-Reply-To: (Peter Maydell's message of "Sat, 8 Mar 2014 14:03:25 +0000") Message-ID: <87eh2ae6ac.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] test-qapi-visit causes clang -fsanitize=undefined warning List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: QEMU Developers , Luiz Capitulino Peter Maydell writes: > On 8 March 2014 12:39, Peter Maydell wrote: >> I've noticed that the tests/test-qapi-visit.c code provokes the following >> complaint from clang's -fsanitize=undefined undefined-behaviour >> checker when you run 'make check': >> >> tests/test-qapi-visit.c:462:33: runtime error: member access within >> null pointer of type 'UserDefA' (aka 'struct UserDefA') > > There's also this clang compile warning which is probably not > related but is also in code dealing with unions: > > CC tests/test-qmp-output-visitor.o > /home/petmay01/linaro/qemu-for-merges/tests/test-qmp-output-visitor.c:452:17: > warning: implicit conversion from enumeration type > 'enum UserDefUnionKind' to different enumeration type > 'UserDefFlatUnionKind' (aka 'enum UserDefFlatUnionKind') > [-Wenum-conversion] > tmp->kind = USER_DEF_UNION_KIND_A; > ~ ^~~~~~~~~~~~~~~~~~~~~ > 1 warning generated. Thanks, I'll look into both.