Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!brutus.cs.uiuc.edu!wuarchive!wugate!uunet!ibmpa!lmb From: lmb@ibmpa.UUCP (Larry Breed) Newsgroups: comp.std.c Subject: Re: Two standards problems Message-ID: <1829@ibmpa.UUCP> Date: 23 Aug 89 22:24:50 GMT References: <178@ixi.UUCP> <183@ixi.UUCP> <10397@smoke.BRL.MIL> <800@cbnewsl.ATT.COM> <806@cbnewsl.ATT.COM> <186@ixi.UUCP> <10724@smoke.BRL.MIL> Reply-To: lmb@ibmpa.UUCP (Larry Breed) Organization: IBM AWD, Palo Alto Lines: 23 In article <10724@smoke.BRL.MIL> gwyn@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@uunet.uu.net uucp: uunet!ibmsupt!lmb (415) 855-4460