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 [email protected] +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
