(j3.2006) kind conversion for intent(in), value dummy arguments

Lionel, Steve steve.lionel
Tue Sep 16 15:59:30 EDT 2008

Dan Nagle wrote:

> Since c_int == kind( 0) on most systems anyway,
> is there really a great benefit for this?

Where it has made a difference for us is when the interface is defined
in terms of C_SHORT or C_SIGNED_CHAR (or the equivalent.)  We have lots
of Win32 API interfaces which take 16-bit or even 8-bit integers, and
the kind conversion allows them to write 0 or 255 rather than 0_2 or
even worse, TRANSFER(255,0_1) or something like that.  I'll note that we
historically (as in at least thirty years) allow values in the unsigned
range to be passed to signed integer arguments (e.g. 255 to an 8-bit
integer), so we allowed that here too.  If we really wanted to be
friendly to C, we could define that for VALUE but my head hurts trying
to figure out how to word that in the standard.


More information about the J3 mailing list