J3/06-167 To: J3 From: Dick Hendrickson Date: 23 April 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 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_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. [298:4+] Insert after line 4 COMPILER_OPTIONS () Compiler invocation information COMPILER_VERSION() 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. There are other proposals to rearrange this section and it is possible more functions will be added (05-252). 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_OPTIONS() Description. Return a processor dependent string describing options which controlled the program translation phase. Class. Inquiry function. Argument. None Result Characteristics. Default character 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 return "/OPTIMIZE /FLOAT=IEEE /CHECK:SUBSCRIPTS". 13.8.2.1B COMPILER_VERSION() Description. Return a processor dependent string identifying the program translation phase. Class. Inquiry function. Argument. None Result Characteristics. Default character with processor dependent length Result Value. A processor dependent value which represents the name and version of the program translation phase of the processor. Example: COMPILER_VERSION() might return "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. 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.