(j3.2006) definition of CFI_CDESC_T

Robert Corbett robert.corbett
Wed Apr 25 02:12:02 EDT 2012


On 04/24/12 01:28, Malcolm Cohen wrote:
> (cc'd to interop-tr which is probably a better place for discussion).
If the discussion is moved to interop-tr, please copy me on e-mail relevant to 
my comments.
>
> That does not look like "a type suitable for declaring a C descriptor" to me.
I agree that your interpretation is reasonable, but I do not think it is the 
only possible interpretation of the phrase.  I think the phrase needs to be 
clarified.  The definition I gave in my previous e-mail satisfies my 
understanding of the phrase.
> Surely, given
>   CFI_CDESC_T(2) x;
> then x must be a C descriptor, and therefore &x must be compatible with 
> CFI_cdesc_t*, and x.base_addr et al should be usable; neither of those things 
> appear to be true of this (that or my eyes have glazed over too much).
I am confused by your assertion that &x must be compatible with CFI_cdesc_t*.  I 
assume you mean that the type of &x and CFI_cdesc_t* becompatible types.  For 
that to be true, the type of x and CFI_cdesc_t must be compatible types [C99: 
6.7.5.1p2].  The TS effectively requires CFI_CDESC_T(2) to be a complete type 
and CFI_cdesc_t to be an incomplete type.  They will have different definitions, 
and therefore they will be different types.  Assuming the type specifiers for 
CFI_CDESC_T(2) and CFI_cdesc_t appear in the same translation unit, they will 
not be compatible types [C99: 6.2.7p1] regardless of how CFI_CDESC_T(2) is 
defined.  Glazed eyes are a natural reaction to reading this part of the C99 
standard.

I think the TS needs to clearly state if the types created by the macro 
CFI_CDESC_T are structure types, and if they are required to be structure types, 
if the members of those types are to be accessible.

Bob Corbett



More information about the J3 mailing list