11-105r1
To: J3
From: Nick Maclaren/Bill Long
Subject: Interop TR: Initialisation using C facilities
Date: 2011 February 15
Reference: N1838
N1838 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.
However, we intentionally want to allow additional hidden members in
the C descriptor, so allowing initializers is problematic.
Initialization by functions is more reliable since the vendor can
provide values for the hidden members if appropriate.
Edit to N1838:
[11:16] Append to the end of the paragraph: "A variable declared using
CFI_CDESC_T shall not have an initializer."