Boost logo

Boost :

From: Daniel Schlyder (daniel_at_[hidden])
Date: 2006-10-12 14:43:58


Peter Dimov wrote:
> Daniel Schlyder wrote:
>
>> BTW, shouldn't the line in mutex.inl that reads
>>
>> OSVERSIONINFO version_info = {sizeof(OSVERSIONINFO)};
>
> This is an idiomatic way to initialize the first member to
> sizeof(OSVERSIONINFO) and the rest to zero.

Ah, ok. So GCC shouldn't emit those missing initializer warnings. Would
be nice to silence them anyway, though. Maybe using

     OSVERSIONINFO version_info = {sizeof(OSVERSIONINFO), 0, 0, 0, 0, 0};

?

>> be replaced with
>>
>> OSVERSIONINFO version_info;
>> version_info.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
>
> This initializes dwOSVersionInfoSize to sizeof(OSVERSIONINFO) and leaves the
> rest uninitialized.

Not a problem if the return value of GetVersionEx() is checked.

-- 
Daniel Schlyder

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk