[libvirt] [PATCH] bhyve: fix build with gcc48

Roman Bogorodskiy bogorodskiy at gmail.com
Sun May 24 07:18:04 UTC 2015


  Eric Blake wrote:

> On 05/23/2015 02:45 PM, Martin Kletzander wrote:
> > On Sat, May 23, 2015 at 08:05:23PM +0300, Roman Bogorodskiy wrote:
> >> Build with gcc 4.8 fails with:
> 
> Arguably a bug in gcc; but since we can work around it without too much
> pain, we should.
> 
> >>
> >> bhyve/bhyve_monitor.c: In function 'bhyveMonitorIO':
> 
> >> bhyveMonitorIO(int watch, int kq, int events ATTRIBUTE_UNUSED, void
> >> *opaque)
> >> {
> >> -    const struct timespec zerowait = {};
> >> +    const struct timespec zerowait = { 0, 0 };
> 
> Would also be sufficient to do 'zerowait = { 0 };' - any C compiler that
> warns about an initializer of { 0 } is broken, because that is THE
> idiomatic way to zero-initialize anything (scalar or structure)
> according to C99.
> 
> > 
> > You "need" to set at least minimum one field, all others will be set
> > to 0.  But this is of course very right thing to do.
> > 
> > ACK, structures shouldn't be initialized this way.
> 
> Go ahead and push as you have it, though, with two members, since we
> know struct timespec has (at least) two members.

Pushed, thanks!

Roman Bogorodskiy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20150524/72037236/attachment-0001.sig>


More information about the libvir-list mailing list