J3/06-167r1 To: J3 From: Dick Hendrickson Date: 7 May 2006 Subject: Edits For Documenting Compiler Versions Reference: Repository J3-033, 05-123R2, 06-136R1, 06-148 This paper describes the edits for WG5 work item J3-033, documenting compiler versions. It is an amended version of 06-148, based on comments from Malcolm. 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_OPTIONS() Originally COMPILER_COMMAND_LINE() in 136R1 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)] "The COMPILER_VERSION and COMPILER_OPTIONS functions provide information about the translation 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_OPTIONS inquiry functions from the intrinsic module ISO_FORTRAN_ENV (13.8.2.1A, 13.9.2.1B) 3. Add the functions to section 13. [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. There are other proposals to rearrange this section and it is possible more functions will be added (05-252). [360:6+] Insert two new sections in alphabetical order and a note 13.8.2.1A COMPILER_OPTIONS() Description. Returns a processor dependent string describing the options that controlled the program translation phase. Class. Inquiry function. Argument. None Result Characteristics. Default character scalar with processor -dependent length. Result Value. A processor-dependent value which describes the options that controlled the translation phase of program execution. Example: COMPILER_OPTIONS() might have the value "/OPTIMIZE /FLOAT=IEEE /CHECK:SUBSCRIPTS". 13.8.2.1B COMPILER_VERSION() Description. Returns a processor-dependent string identifying the program translation phase. Class. Inquiry function. Argument. None Result Characteristics. Default character scalar with processor dependent length. Result Value. A processor-dependent value that identifies the name and version of the program translation phase of the processor. Example: COMPILER_VERSION() might have the value "Super-fast KL-10 Compiler Version 0.1". NOTE: For both COMPILER_OPTIONS and COMPILER_VERSIONS the processor should include relevant information that could be useful in solving problems found long after the translation phase. For example, compiler release and patch level, default compiler arguments, environment variable values, and run time library requirements might be included. A processor might include this information in an object file automatically, without the user needing to save the result of this function in a variable.