J3/00-284 To: J3 From: /Interop Date: 19 Sep 2000 Subject: Issues with Bind(C) Enum Interoperability Introduction. It is not currently clear how the Enum BIND(C) interface produces C interoperability in the case where the enumeration values can be represented as unsigned values but not as signed values of the same length. A C compiler is permitted to use an unsigned type for the representation of an enumeration type 6.7.2.2(4). Fortran can only use a signed type for the representation. As a result, Fortran would need to use a wider type than is used by C. It currently appears to be unclear how this case is handled. To clarify the operation of BIND(C) enums, we propose to add a note to 4.7 clarifying this question. In addition, the note at 16.5 is edited to notice explicitly that values may be interpreted differently in Fortran and in C. Edits 58:39 Insert the following Note: Note 4.x If a companion processor uses an unsigned type to represent a given enumeration type, the Fortran processor will use the signed integer type of the same width for the enumeration even though some of the values of the enumerators cannot be represented in this signed integer type. The values of any such enumerators will be interoperable with the values declared in the C enumeration. 389:21 Insert at the end of note 16.5 Values that can be represented in an unsigned type but not in the corresponding signed type are represented by different values.