(j3.2006) Question about co-arrays
Rob James
rbjames
Fri Feb 9 15:26:54 EST 2007
> > But what is wrong with TRANSFER()?
> TRANSFER to what??? You chose to ignore the bit about unsigned versus
signed
> integers. What size should the integer be? In F2008 we'll have some
features
> to do this (BIT_SIZE extensions, C_SIZEOF, etc.), but show me how to do
it
> with actual portable Fortran 2003 code? Maybe there is a way I don't know
of/
What about INTEGER(C_INTPTR_T)? Assuming that intptr_t exists for the
companion C processor, this should work just fine. It's the same size as a
C_PTR, unless I've missed something.
If you need to know the size of such a dealie, you can use BIT_SIZE. You
can then use that size to calculate the number of digits to output in Z
format (or whatever format you're looking for).
Sure, it's a bit more complicated than just using a printf format, but if
you want something portable, I think this kind of thing would be reasonably
so.
Rob James
XL Fortran Compiler Developer
IBM Toronto Lab
Phone: 905-413-6043
E-mail: rbjames at ca.ibm.com
More information about the J3
mailing list