J3/02-307
Date: October 25, 2002
To: J3
From: Rob James
Subject: Additional constants for the ISO_C_BINDING module
Introduction
------------
The C_INT_LEAST*_T, C_INT_FAST*_T, and C_INTMAX_T constants that
are provided in the ISO_C_BINDING module are important, but there
are other C99 integral types provided by stdint.h that are not
accounted for in this module.
The types int8_t, int16_t, int32_t, and int64_t will probably be
more widely used than their "least" and "fast" counterparts,
because they provide exactly the number of bits requested.
Admittedly, these types need not exist in a given C99
implementation, but they are still very useful and desirable.
There is also one other signed integer type provided in
stdint.h: intptr_t. This type, like the int*_t types, does not
need to exist in a C99 implementation. It could be useful to
provide a constant in the ISO_C_BINDING module that corresponds
to this type as well. Aside from being useful, it would make
this module more complete, in that the module would provide
constants corresponding to all of the signed integral types
provided by C99's stdint.h.
The values of these additional constants could be -2 if the C
companion processor does not define the types corresponding to
these constants (as opposed to -1, which would mean that the type
is defined by the companion C processor, but there is no
corresponding Fortran integer kind).
Proposed Edits
--------------
Page and line numbers refer to the Committee Draft.
[381:20] After "C_SIZE_T," insert "C_INT8_T, C_INT16_T,
C_INT32_T, C_INT64_T,".
[381:22] Remove "and".
[381:22] After "C_INTMAX_T", insert ", and C_INTPTR_T".
[381:23] After "-1", insert
"if the companion C processor
defines the corresponding C type and there is no
interoperating Fortran processor kind or -2 if the
companion C processor does not define the corresponding C
type".
[385:17+] Add the following rows to Table 15.2 below the row
for C_SIZE_T:
(Column 1) (Column 2) (Column 3)
INTEGER C_INT8_T int8_t
INTEGER C_INT16_T int16_t
INTEGER C_INT32_T int32_t
INTEGER C_INT64_T int64_t
[385:17+] Add the following row to Table 15.2 below the row
for C_INTMAX_T:
(Column 1) (Column 2) (Column 3)
INTEGER C_INTPTR_T intptr_t