(j3.2006) Assumed-type and TRANSFER

Clune, Thomas L. GSFC-6101 thomas.l.clune
Fri Sep 30 12:46:49 EDT 2016


I would think that TRANSFER cares a fair bit about the type of its first argument  when MOLD is an array.  Consider the example:

integer ::i
type (foo) :: obj
integer, allocatable :: x(:)
x = TRANSFER(obj,[i])

The compiler must compute the size of the array needed by x to hold the entire bit pattern of obj.

- Tom





On Sep 30, 2016, at 12:28 PM, Lionel, Steve <steve.lionel at intel.com<mailto:steve.lionel at intel.com>> wrote:

I was working on some code where it would have been handy to put an assumed-type dummy argument as the first argument to TRANSFER, which is not allowed per C710 in 16-007r2. I haven?t been able to figure out what problem there would be in allowing this, and haven?t located any earlier discussion of it. Is there something I overlooked? I know how to work around this, but it feels awkward and unnecessary since TRANSFER doesn?t care at all about the type of its first argument.

Steve Lionel
Intel Developer Support
Merrimack, NH

_______________________________________________
J3 mailing list
J3 at mailman.j3-fortran.org<mailto:J3 at mailman.j3-fortran.org>
http://mailman.j3-fortran.org/mailman/listinfo/j3

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.j3-fortran.org/pipermail/j3/attachments/20160930/e127edfb/attachment.html 



More information about the J3 mailing list