qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH RFC v4 02/20] target-arm: Introduce QOM ARMCPUCl


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH RFC v4 02/20] target-arm: Introduce QOM ARMCPUClass
Date: Tue, 13 Mar 2012 12:09:30 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.1) Gecko/20120216 Thunderbird/10.0.1

On 03/13/2012 12:04 PM, Eric Blake wrote:
> On 03/13/2012 11:58 AM, Andreas Färber wrote:
> 
>>>> +static void cpu_register(const ARMCPUInfo *info)
>>>> +{
>>>> +    TypeInfo type = {
>>>> +        .name = info->name,
> 
>>>
>>> Are non-initialized members guaranteed to be zero here?
>>
>> I thought so for the C99-style struct initialization... I never ran into
>> crashes while testing. Do we need static to be safe?
> 
> Yes, C99 guarantees in 6.7.8 p19:

Apologies for my ambiguous answer.  Yes, C99 guarantees that
non-mentioned members are 0-initialized if you have at least one
explicit initialization.  Therefore, no, you don't need static to be safe.

-- 
Eric Blake   address@hidden    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]