Two standards problems
Larry Breed
lmb at ibmpa.UUCP
Thu Aug 24 08:24:50 AEST 1989
In article <10724 at smoke.BRL.MIL> gwyn at brl.arpa (Doug Gwyn) writes:
>
>->(Q11) Can offsetof take "field1.field2" as its second argument ?
>
>This doesn't seem to have been the intent of Standard section 4.1.5.
>
Actually it was the intent. Earlier drafts defined
offsetof(type, identifier)
where the identifier designated a member.
The final draft defined
offsetof(type, member-designator)
and says "... the member-designator shall be such that given
static type t;
then the expression &(t.member-designator) evaluates to an address constant."
This change was made specifically to allow things like
offsetof(struct fancy, inner_struct.a[10])
--
Larry Breed
inet: lmb%ibmsupt at uunet.uu.net
uucp: uunet!ibmsupt!lmb (415) 855-4460
More information about the Comp.std.c
mailing list