Boost logo

Boost :

From: Frank Mori Hess (frank.hess_at_[hidden])
Date: 2008-04-21 17:18:58


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Monday 21 April 2008 16:59 pm, Peter Dimov wrote:
> Juergen Hunold:
> > > Does
> > >
> > > struct timespec rqtp = {};
> > >
> > > still emit the warnings?
>
> ...
>
> > Actually this gets worse :-((
>
> Then we'll have to go with
>
> - struct timespec rqtp = { 0 };
> + struct timespec rqtp = { 0, 0 };
>
> and live with the redundant initializations. GCC can be pretty annoying at
> times. Does anybody actually write {} by mistake? <rolls eyes> :-)

Well, the help describing -Wextra does say:

"... warn about constructions that users generally do not consider
questionable ..."

This is kind of trivial, but I'm curious why not just omit the initialization
entirely, since you set the members individually anyways? Or, you could
memset the whole struct to zero.

- --
Frank
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFIDQTD5vihyNWuA4URAgaoAKCxUPP7rc9dV/MuXF1AjujB+RsQngCgnp/2
MCbZ8HpgtitVZyFhDIAP/mw=
=qHbM
-----END PGP SIGNATURE-----


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