Source-Changes-D archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: CVS commit: src/sys/kern
On Tue, Jan 31, 2012 at 22:53:37 +0000, Alexander Nasonov wrote:
> David Laight wrote:
> > I don't believe there is a problem using m[0], just m[non-constant-expr].
>
> Practically speaking, m[0] is not a problem but the standard says
>
> ... to the structure member (designated by member-designator), ...
> ^^^^^^
Well, the standard also says that:
The type and member designator shall be such that given
static type t;
then the expression &(t.member-designator) evaluates to an
address constant. (If the specified member is a bit-field,
the behavior is undefined.)
Note that the standard doesn't actually bother to define
"memeber-designator" formally, but see 6.7.8 Initialization. We can
haggle about the finer points of specific wording used in the relevant
paragraphs, but I think the intended meaning is pretty clear.
-uwe
Home |
Main Index |
Thread Index |
Old Index