To: J3 10-203r2 From: Bill Long Subject: Interop TR: typedefs for cdesc members Date: 2010 October 11 Reference: 10-165r2.pdf Discussion: The present C descriptor contains multiple members that are expected to have small integer values. The present specification is that each of these is type int. It was proposed at meeting 192 that these should instead have implementation-defined types, as to potentially save space in the descriptor. The current list of members is rank, type, attribute, and state. Realistically, each of these could be as small as an 8-bit byte, and hence could be packed into a single word if desired. The present structures CFI_dim_t and CFI_bounds_t contain members that are typed as size_t. In some cases, these values could be negative (bounds, for example), so size_t is not appropriate. The types need to be signed integers large enough to hold the size of the address space as an integer, such as ptrdiff_t. These specific size_t declarations are replaced by a typedef that is defined in the module. Edits are provided to add four new typedef names, one for each of the current small integer members of the C descriptor, and also a typedef name for the declarations of the members of CFI_dim_t and CFI_bounds_t. The names correspond to standard integer types. If members are added to the C descriptor that have small integer values, those should have corresponding typedef names. Edits to 10-165r2: [9:9] After "bounds_t, " add "typedef definitions for CFI_attribute_t, CFI_index_t, CFI_rank_t, CFI_state_t, and CFI_type_t, ". [9:9] Delete "with type int". [9:27] Replace <> with <>. [9:28] At the end of the paragraph add a new sentence: "CFI_rank_t shall be a typedef name for a standard integer type capable of representing the largest supported rank." [9:29] Replace <> with <>. [9:31] At the end of the paragraph, add a new sentence: "CFI_type_t shall be a typedef name for a standard integer type capable of representing the values for the supported type specifiers." [9:32] Replace <> with <>. [9:34] At the end of the paragraph, add a new sentence: "CFI_attribute_t shall be a typedef name for a standard integer type capable of representing the values of the attribute codes." [9:35] Replace <> with <>. [9:36] At the end of the paragraph, add a new sentence: "CFI_state_t shall be a typedef name for a standard integer type." [10:7] After the second sentence of 5.2.3, para 1, add a new sentence: "CFI_index_t is a typedef name for a standard signed integer type capable of representing the result of subtracting two pointers." [10:7] Replace "It is defined in the file ISO_Fortran_binding.h, and" with "CFI_dim_t" {We already say that the struct is defined in the header file in 5.2.1.} [10:9] Replace <> with <>. [10:10] Replace <> with <>. [10:11] Replace <> with <>. [10:15] Replace "It is defined in the file ISO_Fortran_binding.h, and" with "CFI_bounds_t" {We already say that the struct is defined in the header file in 5.2.1.} [10:17] Replace <> with <>. [10:18] Replace <> with <>. [10:19] Replace <> with <>.