Date: Mon, 4 Jul 2016 10:26:00 +0200 From: Ed Schouten <ed@nuxi.nl> To: Benjamin Kaduk <bjkfbsd@gmail.com> Cc: Bruce Evans <brde@optusnet.com.au>, Konstantin Belousov <kostikbel@gmail.com>, "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>, "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>, "src-committers@freebsd.org" <src-committers@freebsd.org> Subject: Re: svn commit: r302252 - head/sys/kern Message-ID: <CABh_MKmjSJoLYMAsrtgxfZVpedpX9wDz7osFrsz63qawdOkWLQ@mail.gmail.com> In-Reply-To: <CAJ5_RoA-d8YGeFHEiGziOU6VutfuX6cHh%2BJ4YGYPcLhVv77B3w@mail.gmail.com> References: <201606281643.u5SGhNsi061606@repo.freebsd.org> <20160629175917.O968@besplex.bde.org> <20160629145443.GG38613@kib.kiev.ua> <20160629153233.GI38613@kib.kiev.ua> <20160630040123.F791@besplex.bde.org> <20160629211953.GK38613@kib.kiev.ua> <20160701005401.Q1084@besplex.bde.org> <20160630180106.GU38613@kib.kiev.ua> <20160701031549.GV38613@kib.kiev.ua> <20160701185743.Q1600@besplex.bde.org> <20160701142516.GW38613@kib.kiev.ua> <20160702153817.O1458@besplex.bde.org> <CAJ5_RoA-d8YGeFHEiGziOU6VutfuX6cHh%2BJ4YGYPcLhVv77B3w@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
2016-07-04 2:47 GMT+02:00 Benjamin Kaduk <bjkfbsd@gmail.com>: > I did not think that .th_offset.tv_sec was valid [...] It is valid. The ".field = value" construct is called a 'designator' in C's grammar specification. What's on the left of the assignment is called a 'designator-list', which may consist of 1 or more 'designators'. There are two types of designators: '[constant-expression]' and '.identifier'. In other words, it is completely valid to write the following: struct foo bar = { .field[123].something = 456, .field[124].somethingelse = 789, }; Which is the same as: struct foo bar = { .field = { [123].something = 456, [124].somethingelse = 789, }, }; And: struct foo bar = { .field = { [123] = { .something = 456 }, [124] = { .somethingelse = 789 }, }, }; Best regards, -- Ed Schouten <ed@nuxi.nl> Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CABh_MKmjSJoLYMAsrtgxfZVpedpX9wDz7osFrsz63qawdOkWLQ>