From: Tim Deegan Subject: Re: [PATCH v3 5/5] xen/console: Traditional console timestamps including milliseconds Date: Tue, 11 Mar 2014 12:39:31 +0100 Message-ID: <20140311113931.GA64578@deinos.phlegethon.org> References: <1394134085-22952-1-git-send-email-andrew.cooper3@citrix.com> <1394134085-22952-6-git-send-email-andrew.cooper3@citrix.com> <53190AB0.4020806@terremark.com> <531915C4.6060102@citrix.com> <531A573C.6050807@terremark.com> <1394534613.18366.28.camel@kazak.uk.xensource.com> <531EF44D.7080401@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <531EF44D.7080401@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Cooper Cc: Keir Fraser , Ian Campbell , Don Slutz , Xen-devel , Stefano Stabellini , Jan Beulich List-Id: xen-devel@lists.xenproject.org At 11:32 +0000 on 11 Mar (1394533949), Andrew Cooper wrote: > On 11/03/14 10:43, Ian Campbell wrote: > > On Fri, 2014-03-07 at 18:33 -0500, Don Slutz wrote: > > > >> Last I knew (struct tm) { 0 } is > >> > >> struct tm { > >> int tm_sec; /* seconds */ = 0 > >> int tm_min; /* minutes */ > >> int tm_hour; /* hours */ > >> int tm_mday; /* day of the month */ > >> int tm_mon; /* month */ > >> int tm_year; /* year */ > >> int tm_wday; /* day of the week */ > >> int tm_yday; /* day in the year */ > >> int tm_isdst; /* daylight saving time */ > >> }; > >> > > Actually I believe the affect of "struct foo = { 0 }" is to zero > > everything (possibly implicitly by causing it to be placed in .bss), but > > I don't have my copy of the spec to hand to quote chapter and verse on > > that. > > > > Ian. > > > > This is a stack entry, so no .bss involved. Sadly, all the time > functions pass `struct tm`s around by value rather than pointer, and > there is probably easy room for optimisation there. > > As for { 0 }, it is indeed special, but even with a copy of the C spec > to hand, I cant see where it is exactly specified. The disassembly of > wallclock_time() does indeed confirm that the entire structure is zeroed. Yes, all unspecified fields in a struct initialiser are set to 0. Tim.