(j3.2006) (SC22WG5.3587) OPTIONAL arguments and C interop

Jim Xia jimxia
Wed Jul 16 16:54:41 EDT 2008


j3-bounces at j3-fortran.org wrote on 07/16/2008 04:39:44 PM:

> 
> On Wed, 2008-07-16 at 15:25 -0400, Jim Xia wrote:
> > Not able to support OPTIOANL with VALUE attribute is a significant
> > technical reason. 
> 
> I still don't understand the technical reason for this technical reason.
> 

Based on the current design, the caller will pass the address of the 
object to the procedure.  So if the dummy argument is NULL (value 0 on 
most systems), then it is treated as if the dummy argument not present. So 
under this scheme, value 0 or non-zero always used as a flag to indicate 
if the dummy argument is present or not.  If VALUE attribute is allowed, 
then a value of 0 is perfectly legal value to pass to the procedure.  Then 
the scheme wouldn't work.  That's why the VALUE attribute is not allowed 
here.

I think we should be all converted to C's religion to accept this 
proposal.  Should we start thinking to explicitly put in standard a 
chapter about calling conventions so all vendors will do the calls the 
same way -- sigh.

Cheers,

Jim Xia

RL Fortran Compiler Test
IBM Toronto Lab at 8200 Warden Ave, Markham, On, L6G 1C7
Phone (905) 413-3444  Tie-line 313-3444
email: jimxia at ca.ibm.com
D2/YF7/8200 /MKM
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://j3-fortran.org/pipermail/j3/attachments/20080716/f739c7ff/attachment.html 



More information about the J3 mailing list