This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: [PATCH] C99 initializers for login/tst-utmp.c
On Thu, Jan 02, 2003 at 11:11:18PM +0100, Jakub Jelinek wrote:
> On Thu, Jan 02, 2003 at 02:08:44PM -0800, Roland McGrath wrote:
> > > On Thu, Jan 02, 2003 at 09:06:13AM -0600, Art Haas wrote:
> > > > @@ -77,23 +77,23 @@
> > > > struct utmp entry[] =
> > > > {
> > > > #if _HAVE_UT_TV || defined UTMPX
> > > > -#define UT(a) ut_tv:{tv_sec:(a)}
> > > > +#define UT(a) .ut_tv = { .tv_sec = (a)}
> > >
> > > Why not #define UT(a) .ut_tv.tv_sec = (a) instead?
> >
> > The struct initializer also clears tv_usec.
>
> That's cleared anyway (all fields not initialized explicitely
> are set to 0).
>
When I made the patch, I just did a straight conversion to what
is shown above. It was a simple-minded patch to switch from the
GCC syntax to C99 syntax, so I didn't try and be more clever
than the original code.
Art Haas
--
They that can give up essential liberty to obtain a little temporary safety
deserve neither liberty nor safety.
-- Benjamin Franklin, Historical Review of Pennsylvania, 1759