11-105 To: J3 From: Nick Maclaren Subject: Interop TR: Initialisation using C facilities Date: 2011 January 19 Reference: 10-251.pdf 10-251 initalises descriptors almost entirely by calling functions that update a previously declared descriptor. However, C99 added the facility to initialise structures by descriptor. I realised after writing 10-232r2 that I had forgotten to check that aspect of the C standard and it was then too late to do so. I have now done so, and have reminded myself how problematic that area of the C standard is. In particular, it is most unclear whether a structure containing a flexible member is a complete or incomplete type (or both or neither or what), which is critical to 6.2.7 paragraph 1 (compatibility of structure types) and hence this issue. [ Aside: if anyone looks at it, the condition "declared in different translation units" doesn't mean what it seems to. ] There are two reasonable possibilities. One is to forbid the use of C initializers, which seems a bit harsh, and the other to spell out what is required, copying (and slightly simplifying) the terminology from that. Option 1: --------- Edits to 10-251: [11:16] Append to the end of the paragraph: "A variable declared using CFI_DESC_T shall not have an initializer." Option 2: --------- [11:16] Append to the end of the paragraph: "The type that CFI_DESC_T evaluates to is a structure type, with members that correspond one-to-one with those of CFI_desc_t, with corresponding members declared with the same types and names, except that the last is an array of type CFI_dim_t of length the evaluated argument and not a flexible array."