J3/06-148 To: J3 From: Dick Hendrickson/JOR Date: 16 Feb 2006 Subject: Edits For Documenting Compiler Versions Reference: Repository J3-033, 05-123R2, 06-136R1 This paper describes the edits for WG5 work item J3-033, documenting compiler versions. Paper 06-136R1 specified two new functions to document the compile time environment. They are: COMPILER_VERSION() Returns a processor dependent result that describes the compiler name, version, or related information. COMPILER_COMMAND_LINE() Returns a processor dependent representation of the command line that invoked this compilation. The result may include additional information, such as default options or options specified by environment variables. EDITS: 1. Insert a sentence in the new 2008 features list. The exact wording is left to the editor. A suggestion is: [xiii, insert as new item (1)] "J3 is proud to announce an exciting new concept in Fortran 2008: Processor dependent functions that are user controllable! The COMPILER_VERSION and COMPILER_COMMAND_LINE intrinsic functions provide information about one phase of the execution of a program." 2. Modify chapter 7 to allow the new functions in initialization expressions. [126:3-4+] insert a new bullet item in the list move the "or" from the end of bullet item (7) to item (8) and add "(9) The COMPILER_VERSION or COMPILER_COMMAND_LINE inquiry functions (13.8.2.1A, 13.9.2.1B) [127:10] Insert ", if any," after "function argument" so that the new line reads "A specification inquiry where each designator or function argument, if any, is" 3. Add the functions to section 13. [298:4+] Insert after line 4 COMPILER_COMMAND_LINE () Obtain compiler invocation information COMPILER_VERSION() Obtain compiler identification [360:3] Insert "and intrinsic procedures" after "named constants" so the new line reads "The processor shall provide the named constants and intrinsic procedures described in the following subclauses." Alternatively, the section could be rearranged to separate functions and constants. I think there are other proposals to rearrange this section and it is possible more functions will be added. Putting them in the middle looks awkward, but can serve as a place holder. [360:13] Insert two new sections and a note 13.8.2.1A COMPILER_COMMAND_LINE() Description. Return a processor dependent version of the command line which invoked the compiler. Class. Inquiry function. Argument. None Result Characteristics. Default character with processor dependent length Result Value. A processor dependent value which represents the command line which invoked the compile phase of program execution. If there was no command line, the result is processor dependent. 13.8.2.1B COMPILER_VERSION() Description. Return a processor dependent identification of the compiler. Class. Inquiry function. Argument. None Result Characteristics. Default character with processor dependent length Result Value. A processor dependent value which represents the compiler name and version information. NOTE: The preceding two functions should return information that will be useful in describing problems found long after the compilation phase of program execution. The processor is free to add other information, such as default compiler arguments, environment variable values, run time library requirements, etc., as appropriate. Although they appear to be functions, they should be evaluated and directly inserted in the executable image (the ".o" file) as character values at compile time. This will insure that the information refers to the current compile step and allow for separate compilation. Compilers should attempt to place the values in the execution image in a way that will allow them to be extracted by other tools in the event of a subsequent execution failure.