[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] test-qapi-visit causes clang -fsanitize=undefined warni
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] test-qapi-visit causes clang -fsanitize=undefined warning |
Date: |
Mon, 10 Mar 2014 10:45:15 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) |
Peter Maydell <address@hidden> writes:
> On 8 March 2014 12:39, Peter Maydell <address@hidden> 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.