J3/05-277 Date: 24 October 2005 To: J3 From: Aleksandar Donev Title: Interoperability of optional arguments Status: For consideration Basic Functionality: Extension to C Interop that allows optional arguments to be interoperable. Rationale: If C functions have a mechanism to indicate and detect missing optional arguments, the class of Fortran subprograms that interoperate with C would be significantly expanded. Estimated Impact: Small impact for the standard and probably small to moderate impact for the processors. Detailed Specification: A procedure interface which has OPTIONAL dummy arguments can have the BIND(C) attribute and be interoperable. The VALUE attribute is not allowed for optional dummy arguments in a BIND(C) interface. The interoperable C prototype is the same as if the OPTIONAL attribute were not present, the only difference is the function reference on the C side. Namely, a C caller specifies a missing actual argument in a function reference by passing a NULL data pointer as the argument value if the corresponding dummy argument is a data object, or a NULL procedure pointer as the argument value if the corresponding dummy argument is a procedure. A Fortran procedure, as usual, omits the actual argument in the procedure reference. History: Paper 04-373 meeting 169 Submitted 171 Accepted as complete ------------------------------------------------------------------