From mboxrd@z Thu Jan 1 00:00:00 1970 In-Reply-To: <20050705152713.GA12762@ionkov.net> References: <09405af8d5c18c32321c0de7b2fd90d3@terzarima.net> <3e1162e6050704193649539ee@mail.gmail.com> <20050705152713.GA12762@ionkov.net> Mime-Version: 1.0 (Apple Message framework v730) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <310D4BA6-03CF-43D6-8E1D-7B5F312E85F7@gmail.com> Content-Transfer-Encoding: 7bit From: David Leimbach Subject: Re: [9fans] 8c question Date: Tue, 5 Jul 2005 08:35:01 -0700 To: Latchesar Ionkov Cc: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu> Topicbox-Message-UUID: 61ba6776-ead0-11e9-9d60-3106f5b1d025 On Jul 5, 2005, at 8:27 AM, Latchesar Ionkov wrote: > An example: > > typedef struct { > .... > arch_vcpu_info_t arch; > } vcpu_info_t; > > For x86_32 and x86_64 arch_vcpu_info_t is defined as: > > typedef struct { > } arch_vcpu_info_t; > That's undefined behavior by the C99 standard, as far as I can tell. You are supposed to have a non-empty list of identifiers and types in any given struct or union. Definitely not good for portability. Dave > Lucho > > On Mon, Jul 04, 2005 at 07:36:58PM -0700, David Leimbach said: > >> On 7/2/05, Charles Forsyth wrote: >> >>>>> it cant be worked around without breaking the cross >>>>> platform features of their headers. >>>>> >>> >>> sounds brilliantly portable to me. >>> what do they do? insert 0-length padding areas >>> to make these structures `portable'? >>> >>> >>> >> Yeah, it's undefined what happens if a struct is empty in C99. >> Seems a >> really silly thing for someone to rely on. What are they trying to >> accomplish? The only thing I can think of is some kind of type >> safety >> based on a tag generated for a unique "struct". They should probably >> make it wrap a void * or something. >