J3/01-167r1 Date: 22 March 2001 From: Toon Moene To: J3 Subject: Unresolved issues 144, 240, 242, 248, 254, 264. References: 01-007 ---oooOOOooo--- 1. Unresolved issue 144 on page 20. /Interop decided that this was better treated in paper 181 originally on unresolved issues 177 and 168 on page 270. ---oooOOOooo--- 2. Unresolved issue 240 on page 234. The issue discusses the possibility to define the main program by means other than Fortran. This possibility should be mentioned here. It would also have impact on subclause 2.1 where it says that "A program shall contain exactly one ". Issue 240 also asks to add a note or an Appendix C paragraph discussing the runtime environment issues. Edits: [233:37] Add after note (as normative text) "The main program may be specified by means other than Fortran; in that case the program shall not contain a ." [9:11] Replace "A program shall contain exactly one ." with "A program shall contain exactly one or a main program provided by means other than Fortran, but not both." [461:5] Add "C.12.1 Runtime environments This standard allows programs to contain procedures specified by means other than Fortran. That induces the issues of initialisation of and interaction between the runtime environments involved. Implementations are free to solve these issues as they see fit, provided that: 1. Heap allocation/deallocation (e.g., (DE)ALLOCATE in a Fortran subprogram and malloc/free in a C function) can be performed without interference. 2. I/O to and from external files can be performed without interference, as long as procedures specified by different means do not do I/O to/from the same external file. 3. I/O preconnections exist as required by the respective standards. 4. Initialised data is initialised according to the respective standards. 5. The command line environment intrinsic routines GET_COMMAND, GET_COMMAND_ARGUMENT, COMMAND_ARGUMENT_COUNT and GET_ENVIRONMENT_VARIABLE function correctly, even if the main program is provided by means other than Fortran." {with suitable renumbering of C.12.1 and C.12.2} [234:1-10] Delete ---oooOOOooo--- 3. Unresolved issue 242 on page 270. This issue is concerned with "calling the main program" in Fortran from C. The standard should not allow the Fortran be callable from C. We think that it is already impossible to invoke the main program, if it is specified in Fortran, from either Fortran or C: a. A cannot be invoked from within a Fortran program, because it is neither a SUBROUTINE or a FUNCTION. b. Because syntactically (11.1) it cannot have a , it is not interoperable with any C procedure - therefore it cannot be invoked from a C routine. It is not a problem to call the C
function from Fortran or C - the C
function is not the "main program" of a C program. [270:34-37] Delete ---oooOOOooo--- 4. Unresolved issue 248 on page 388. This issue raises the question of providing access to errno. We think that the standard offers sufficient means to write and invoke C routines to query and set errno (C standard 7.5); therefore, we propose not to add any specific changes to the standard to enable this. [388:19-21] Delete. ---oooOOOooo--- 5. Unresolved issue 254 on page 389. In discussing the r0 of this paper, the editor commented that - since the time he wrote the note containing the unresolved issue - other changes to the draft standard (notably the example 16.19 on page 396) sufficiently clarified the issue. Case closed. [389:21-24] Delete. ---oooOOOooo--- 6. Unresolved issue 264 on page 59. The editor asks if "type compatibility" in the C standard doesn't just simply mean that "two enumeration types are compatible if (and only if) they specify enumeration constants with the same names and same values in the same order". It is something defined by the C standard, not the C processor. Therefore the first sentence in Note 4.63 is incorrect. The Fortran standard sets a requirement for the "companion C processor" in specifying that it has to obey an additional constraint. Edits: [59:18] Replace "The C standard requires a processor to make two enumeration types compatible only if they" with "The C standard specifies that two enumeration types are compatible only if they" [59:23-31] Delete.