Date: Wed, 2 Nov 2011 23:56:07 +0000 From: Alexander Best <arundel@freebsd.org> To: freebsd-hackers@freebsd.org Subject: question regarding style(9) and field initialisers in structs Message-ID: <20111102235607.GA61095@freebsd.org>
next in thread | raw e-mail | index | archive | help
i sent the following message to freebsd-quaestions@ and got no answer. mybe it
is better suited for freebsd-hackers@.
hi there,
i found hundreds of the following cases in the FreeBSD src:
[...]
struct periph_driver {
	periph_init_func_t	init;
	char			*driver_name;
	TAILQ_HEAD(,cam_periph)	units;
	u_int			generation;
	u_int			flags;
	#define CAM_PERIPH_DRV_EARLY	0x01
};
[...]
static struct periph_driver dadriver =
{
	dainit, "da",
	TAILQ_HEAD_INITIALIZER(dadriver.units), /* generation */ 0
};
...is it proper programming practice to forget about the last field, if it
would have been initialised to 0?
cheers.
alex
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20111102235607.GA61095>
