svn commit: r302252 - head/sys/kern

Konstantin Belousov kostikbel at gmail.com
Mon Jul 4 01:51:33 UTC 2016


On Sun, Jul 03, 2016 at 07:47:15PM -0500, Benjamin Kaduk wrote:
> On Sat, Jul 2, 2016 at 3:04 AM, Bruce Evans <brde at optusnet.com.au> wrote:
> 
> > +       .th_counter = &dummy_timecounter,
> >> +       .th_scale = (uint64_t)-1 / 1000000,
> >> +       .th_offset = {1, 0},
> >>
> >
> > Is there a syntax for avoiding the explicit 0 in a nested initializer?
> > Something like th_offset.tv_sec = 1.
> 
> 
> C99 does not require complete initializers (though my habit of running with
> clang -Weverything does).  Just .th_offset = {1} should give the desired
> result here.  I did not think that .th_offset.tv_sec was valid, though, so
> when not-the-initial element is nonzero some zeros would still be needed.

Of course .th_offset.sec is not valid, but the patch posted later contained
the correct expression
	.th_offset = { .sec = 1 }


More information about the svn-src-all mailing list