Home
Here - Cleanscape Products
Contents
1. CONTAINS Seas Internal subprograms SUBROUTINE M_INNER TYPE1 TYPE2 YPE MYTYPE INTENT INOUT TYPE1 YPE MYTYPE INTENT IN TYPE2 YPE1SNAME ALIAS TYPE2 NAME END SUBROUTINE M_INNER END MODULE SUBROUTINE OUTER TYPE1 TYPE2 OPDUM Declaration USE M ONLY YTYPE TYPE MYTYPE INTENT INOUT TYPE1 TYPE2 INTEGER OPTIONAL OPDUM Er wen Double TYPE2 s scores if PRESENT OPDUM THEN YPE14SCORES 1 1 TYPE2 SCORES 1 OPDUM ELSE YPE1 SCORES 1 1 TYPE2 SSCORES 1 1 2 ENDIF END SUBROUTINE PROGRAI AIN Eee ain program USE M IYPE_S gt MYTYPE amp YLOC gt LOC private modul ntities cannot be accessed CHARACTER LEN 10 STR TYPE TYPE S STUDENT1 STUDENT2 CALL M INNER STUDENT1 STUDENT2 CALL OUTER STUDENT1 STUDENT2 STR GRADE 3 AVE MAIN_INNER STUDENT13SCORES CONTAINS Internal subprograms are in another file INCLUDE demo90 inc END Cleanscape Software FortranLint User s Manual Version 6 x 124 Appendix D Sample Output Fortran 90 I demo90 inc FUNCTION MAIN_INNER DUM REAL INTENT INOUT DUM REAL KIND KIND 0 0D0
2. INTRFC FYI 256 4x passed to a dummy arg same format but different names SYNTAX FYI 105 1x string will be truncated from to chars USAGE ERR 126 1x local variable is referenced but never set USAGE WARN 127 1x local variable is set but never referenced SYNTAX ERR 168 1x array referenced with too few subscripts INTRFC ERR 252 1x array passed to dummy arg which is a array SYNTAX ERR 661 1x entity not accessible in module USAGE WARN 743 1x module entity set but not referenced USAGE FYI 744 1x unused module entity Total messages 12 Errors Warnings FYIs Syntax 2 0 1 Interface 1 0 4 Data usage 1 2 i Implicit typing lt supp gt D 4 Call Tree This is a primary tree starting at the program MAIN MAIN M Z H z Ei x 0UTER M MAIN_INNER Cleanscape Software FortranLint User s Manual Version 6 x 128 Appendix D Sample Output Fortran 90 D 5 Freeform Cross Reference kk SYMBOL TABLE Program MAIN Subroutines M INNER OUTER Functions M internal defined at line 25 of demo90 KKK KKK KK defined at line 38 of demo90 90 Calls demo90 90 M demo90 90 M M_INNER demo90 90 0UT1 defined at line 16 Args type MYTYPE S Called by demo90 90 Args type MYTYPE S Calls demo90 90 M Called by demo90 f 90 290 E
3. USAGE ERR 126 USAGE WARN 127 USAGE FYI 128 USAGE ERR 133 USAGE FYI 135 INTRFC WARN 185 INTRFC ERR 248 INTRFC ERR 252 INTRFC ERR 287 Total messages 16 branch into do loop via label not enough arguments too many arguments constant is changed by subprogram expression is changed by subprogram this name is defined as a subroutine common block organization differs at member compared to initial use in routine local variable is referenced but never set local variable is set but never referenced local variable declared but unused common block members referenced but not set unused common block members common block length mismatch compared to initial use in routine passed to a dummy arg lx array passed to dummy arg which is a array 1x array passed to array of larger size by bytes XXX XX X X XX X X KX x Errors Warnings FYIs Syntax 0 1 0 Interface 7 3 0 Data usage 2 1 2 Implicit typing lt supp gt Cleanscape Software FortranLint User s Manual Version 6 x 138 Appendix E Sample Output FORTRAN 77 E 4 Call Tree This is a primary tree starting at the program PROCDAT PROCDAT GETUNIT READNAME SETTYPE PRINT 1 PRINTIT DIPSTAT PRINT GETUNIT PRINT see 1 E 5 Freeform Cross Reference kk SYMBOL TABLE
4. Asserts that the flagged argument is optional For example subroutine foo a b o c o d o e integer a b c d e end This stub asserts that the middle three arguments to foo are optional q Suppresses data type checking and or error 251 scalar passed to array Typically this switch is used to flag arguments that can be represented in different ways For example assume that a subroutine named bar takes a quadword 64 bit argument and assume that bar doesn t care if the caller passes a two element array of integer 4 or a four element array of integer 2 In this case the following stub could be used subroutine bar x q integer 2 x 4 end v Asserts that the flagged argument is passed by value For example subroutine foo n v integer n end If this stub is used FortranLint assumes that foo can be called as follows call foo val 3 Cleanscape Software FortranLint User s Manual Version 6 x 76 9 Library Support z Suppresses all interface checking related to the flagged argument For example integer function foo a b z integer a b end If this stub is used FortranLint checks the first argument for every call to foo but does not check the second argument s Asserts that the flagged argument is set r Asserts that the argument is referenced i Asserts that the argument s reference set status is indeterminate For example subroutine modtab a r
5. Database U home monty install flint Examples preprocessor p CPP all sources Defines Include file search path portability _ ANSI 77 ANSI 90 CRAY DECNT 1 DECUNIX _ DECVMS EPC HPIUX LAHEY NCUBE _ 0532 Sal SUN levels of analysis M u data usage checking M w wamings X t informational FYI M m implicit typing X g global analysis Cross reference options o unreferenced parameters no_unused_common_variables line Cleanscape Software FortranLint User s Manual Fig 13 1 Xlint Build Configuration window Version 6 x 14 Xlint Getting Started 93 14 VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV Xlint Getting Started 14 1 Configuration Setup For installation instructions see Appendix H or I In particular note that a resource file should be copied to the appropriate directory For additional information on resource files see the installation instructions and chapter 16 Also note that three UNIX environment variables or VMS logicals should be set for each X lint user XLINTHOME Path for the directory that contains the X lint support files XLINTHOST Network name or node name for the system running the X lint license manager XLINTPATH Path for the directory that contains the user s FORTRAN source files 14 2 Running Xlint Before X lint can be used the user
6. N A By default if the source format is fixed form characters past column 72 are ignored If this option is specified the source line width is extended to 132 columns For additional information see section 4 1 e EXTEND Reads a specified file and adds its contents to the FortranLint command line The file may contain source file names and or command line option switches Entries may be separated by commands new lines or spaces and may be specified in any order Nested expansions are allowed i e the specified file may use the E or FILES option to process lower level files Wildcards are not supported I e the specified file cannot include entries of the form for This option cannot be suppressed i e E and NOFILES are not supported For additional information see section 3 3 E file FILES file FortranLint User s Manual Version 6 x F FLOW D escription Syntax VMS syntax FORM See R f FYI D escription Syntax V MS syntax g GLOBAL D escription Syntax V MS syntax i INCLUDE D escription Syntax VMS syntax Cleanscape Software 3 Command Reference 17 Enables local dataflow analysis For more information see Section 5 6 F FLOW on Enables FYI or for your information diagnostics FYI diagnostics are informational messages that may or may not indicate problems f FYI
7. gt USE M TYPE_S gt MYTYPE amp gt MYLOC gt LOC Iprivate modul ntities cannot be accessed gt N demo90 90 MAIN line 42 SYNTAX ERROR 661 entity not accessible in module M gt CALL M_INNER STUDENT1 STUDENT2 gt A demo90 90 MAIN line 46 INTERFACE FYI 256 type TYPE_S passed to a type MYTYPE dummy arg same format but different names gt CALL M_INNER STUDENT1 STUDENT2 A demo90 90 MAIN line 46 INTERFACE FYI 256 type TYPE S passed to a type MYTYPE dummy arg same format but different names gt CALL OUTER STUDENT1 STUDENT2 gt N Cleanscape Software FortranLint Users Manual Version 6 x Appendix D Sample Output Fortran 90 125 demo90 90 MAIN line 47 INTERFACE FYI 256 type TYPE S passed to a type MYTYPE dummy arg same format but different names gt CALL OUTER STUDENT1 STUDENT2 gt N demo90 90 MAIN line 47 INTERFACE FYI 256 type TYPE_S passed to a type MYTYPE dummy arg same format but different names gt AVE MAIN_INNER STUDENTI1 SCORES gt N demo90 90 MAIN line 49 INTERFACE RROR 252 I 4 array passed to dummy arg which is a R 4 array 28 T T demo90 90 MAIN line 46 USAGE ERROR 126 local variable STUDENT2 is referenced but never set demo90 90 MAIN line
8. options To redirect output under VMS use the options OUTPUT SPLIT or SUMMARY For additional information on S and SPLIT see section 2 3 1 or chapter 3 For additional information on and SUMMARY see section 2 3 3 or chapter 3 To modify the output page width or page length use W and Y or WIDTH and LPP under VMS Cleanscape Software FortranLint User s Manual Version 6 x 48 6 Analysis Output 6 2 Summary Mode FortranLint provides an optional progress meter The progress meter is a stationary counter displayed on the console that tracks the progress of analysis from 0 to 100 To display the progress meter use or SUMMARY under VMS By default these options divert normal flint output to a set of text files Specifically enabling the progress meter also sets the option Sflint or SPLIT flint under VMS These options send analysis output to flint Int statistics output to flint stt etc To specify a different base name add an explicit S or SPLIT option to the command line Note After analysis is complete FortranLint erases the progress meter and displays a summary of the messages produced For additional information see sections 2 3 1 and 2 3 3 6 3 Output Details 6 3 1 Options and Filenames The first line of the analysis output shows the FortranLint revision number and the current date and time The next few lines show the selected
9. x Program PROCDAT defined at line 2 of demo f Calls demo f GETUNIT demo f READNAME demo f SETTYPE demo f PRINT Subroutines DIPSTAT defined at line 48 of demo f Args I 4 S R 4 R Calls demo f PRINT Called by demo f PRINTIT GETUNIT defined at line 14 of demo f Args I 4 S I 4 R Called by demo f PROCDAT demo f PRINTIT PRINT defined at line 33 of demo f Args struct ITEM R I 4 R Calls demo f PRINTIT Called by demo f PROCDAT demo f SETTYPE demo f DIPSTAT PRINTIT defined at line 38 of demo f Args I 4 R struct ITEM R Calls demo f DIPSTAT demo f GETUNI Called by demo f PRINT READNAME defined at line 19 of demo f Args CHAR S R 8 array S Called by demo f PROCDAT SETTYPE defined at line 27 of demo f Args struct ITEM RS Calls demo f PRINT Called by demo f PROCDAT T Common blocks BK2 size 8 bytes Members COUNT TIME Defined in demo f PROCDAT demo f SETTYPE demo f PRINT demo f PRINTIT BLOCK size 6 bytes Members INUSE STATUS Defined in demo f PROCDAT demo f READNAME demo f SETTYPE demo f PRINT demo f PRINTIT Cleanscape Software FortranLint User s Manual Version 6 x Appendix E Sample Output FORTRAN 77 139 Structures ITEM size 26 bytes NAME CHAR 10 in
10. Cleanscape Software FortranLint User s Manual Version 6 x 103 Appendices Cleanscape Software FortranLint User s Manual Version 6 x Appendix A Installation 105 Appendix A VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV Installation Windows Unix Linux A 0 Windows Installation 1 GUI installation a Execute flintwin exe Note You can run this program from any drive or directory An installer window should appear Click the Install button This should extract a number of files After all files are extracted click Exit Note The installer creates a shortcut automatically The shortcut should appear roughly one second after all files are extracted Run FortranLint To do so double click the FortranLint shortcut FortranLint should display a registration prompt Call Cleanscape at the number on the title page and ask for a registration key or email your server code to support cleanscape net Enter the registration key supplied and click on Yes If you install FortranLint under Windows 2000 as Administrator and you want to make the program accessible to ordinary users some additional steps are reguired For more information see the OuickStart guide stored as CA Cleanscape FLINT Dod flintgui pdf The G UI version of FortranLint is now installed Note A reboot is not required To run the program use the shortcut created by the
11. Cleanscape Software FortranLint User s Manual Version 6 x 68 8 Cross Reference 8 4 Content Selection NOTE As of 6 0 the separator between sentence fragments is now instead of The character is used in numerous intrinsic symbol names X and XREF both accept content sdedion arguments Content selection arguments are sentence fragments composed of one to six words separated by periods or single dots Each sentence fragment describes a criterion that can be used to select add to or filter cross reference output A complete content selection includes the following words as its arguments X conjunction usage scope class named xxx XREF conjunction usage scope class named xxx under VMS Conjunctions Usage Adjective Scope Adjective Class N oun only used unused local routines and ref unref dummy nondummy programs no set unset statement nonstatement subroutines called uncalled intrinsic nonintrinsic functions indeterm determ global blockdata actual notactual common noncommon modules init uninit external nonexternal extern decl undecl internal noninternal blocks equiv unequiv structures variables scalars arrays records parameters Note The default conjunction is only While any of the words composing the criteria sentence are optional the order of the words is significant All words may be abbreviated as long as they remain unambig uous A few examples are Ex
12. As lower case letter options may be combined into a single switch For example the following commands are equivalent flint IMPLICIT XREF NOI4 foo for flint mx2 foo for Additional VMS examples 1 flint IMPLICIT foo for flint m foo for 2 flint SPLIT result WARNINGS WIDTH 50 foo for flint Sresult w W50 foo for 3 flint ANSI FYI GLOBAL SUPPRESS 201 202 foo for flint afg O201 O202 foo for Cleanscape Software FortranLint User s Manual Version 6 x 3 2 Summary of Options 3 2 1 UNIX Option Summary Source configuration options d I path P R form V system 1 1 1 1 WwW ONN Diagnostic options Ba ho O number P system u W Cross reference options X X option Call tree options t T option Output format options I l 0 message format W number Y number Cleanscape Software 3 Command Reference 31 Process debug lines Extend source width to 132 columns Set search path for INCLUD E files Send source files through preprocessor CPP Specify Fortran 90 95 source form Specify FO RTRAN dialect Two byte integers and logicals Select FORTRAN 77 Select Fortran 90 95 Select Fortran 2003 Report non A NSI constructs Report FY I messages Enable global processing Report implicit typing Suppress individual error messages Enable portability checking Check data usage Enable warnings
13. Global analysis This option is strongly recommended By default subprograms are processed on an individual basis and call interface checking is not performed The g or GLOBAL option enables global analysis If this option is used FortranLint checks for inconsistencies between subprograms for example invalid arguments or common block problems This option also improves usage checking and enhances cross reference output g GLOBAL Expands INCLUDE files in source listings This option applies only when source listings are enabled see 1 or LISTING INCLUDE FortranLint User s Manual Version 6 x 3 Command Reference I PATH D escription Adds one or more directories to the include file search list This switch affects both INCLUDE files and include files For additional information see sections 4 2 and 4 3 Syntax I path VMS syntax PATH path E xample I myftn usr sam headers PATH FTNCODE USR HEADERS under VMS IMPLICIT See m LANG See 7 and 9 I LISTING D escription Outputs a source listing with line numbers Syntax 1 lower case ell VMS syntax LISTING L LIBRARY Description Creates or updates a library template file This option adds interface information for the current source files to the specified library template or Ibt file Ibt files may be used to speed up subsequent runs For additional
14. SUM 0 DONAME1 DO 10 I 10 SIZE DUM 1 DONAME2 DO 20 J 10 SIZE DUM 2 IF SUM lt 0 CYCLE DONAME2 SUM SUM DUM I J IF SUM gt 100 EXIT DONAME1 20 END DO DONAME2 10 END DO DONAME1 MAIN_INNER INT SUM END FUNCTION D 2 Analysis Output FortranLint Rev 5 0 2 Jan 02 10 49 55 Page 1 Default options w u 0207 276 76 261 Ttrim Xno unreferenced parameters Xno unused common variables Command options f g s t x Sdemo90 demo90 90 KKK KKK KKK KKK KKK KK KKK KKK KKK KK KKK KKK KKK KKK KH KK AH KK KH TH KH KH TH KH KH TH KH KK A KK KH KK KH KK KH TH KH KK AH KH TH AH A KH KU KU Subroutine M_INNER File demo90 90 Line 16 lt Module subprog of M gt gt TYPELSNAME ALIAS TYPE2 NAME gt N demo90 90 M_INNER line 19 SYNTAX FYI 105 string will be truncated from 17 to 10 chars KKK KKK KKK KKK KKK KKK KKK KR KKK KKK KKK KKK KKK KKK KH KK A KK KH KK KH TH KH KH FH KH KK A KK KH KK KH KK KH TH KH KK AH KH TH AH A KH KU KU Subroutine OUTER File demo90 90 Line 25 gt TYPE1 SCORES 1 1 TYPE2 SCORES 1 OPDUM gt N demo90 90 0UTER line 32 SYNTAX ERROR 168 array referenced with too few subscripts KKK KKK KKK KKK KK KKK KKK KKK KKK KK KK KKK KKK KKK KH KK KH KK KH TH KH KH KK KH TH KH KK A KK KH KK KH TH KH KH TH KH KK AH KH TH AH A KH KU KU Program MAIN File demo90 f 90 Line 38
15. selected char kind ascii This results in Message 276 but as you can see from above this message is suppressed by default 276 is an FYI only because it is numeric conversion an integer to character conversion attempt warrants Error 161 Cleanscape Software FortranLint User s Manual Version 6 x 36 3 Command Reference 3 4 Environment Variables Logicals FortranLint recognizes the following environment variables or logicals under VMS Variable Description FLINTCFG Directory that contains alternate support files see below FLINTHOME FortranLint installation directory FLINTHOST Hostname of system running license manager daemon TMPDIR UNIX only Directory used for temporary files SYS SCRATCH VMS only Directory used for temporary files FLINTHOME specifies the location of the main FortranLint directory i e the directory where the flint binary exists This variable is set during installation see Appendix A or Appendix B Flint includes a license manager daemon see Appendix C FLINTHOST specifies the system where the daemon resides This variable is also set during installation FortranLint uses the following run time support files flint cfg Configuration file see section 3 4 flint err Error messages flint hls Help file ieeea lsh IEEE Arithmetic intrinsic module ieeee lsh IEEE Exceptions intrinsic module ieeef Ish IEEE Features intrinsic module isobind sh ISO C Binding intrinsic module isoenv
16. 109 110 113 113 113 115 116 119 119 119 120 121 Version 6 x IV Table of Contents Appendix D Sample Output Fortran 90 D 1 Sample Fortran 90 Program D 2 Analysis Output D 3 Statistics Output D 4 Call Tree D 5 Freeform Cross Reference D 6 Tabular Cross Reference Appendix E Sample Output FORTRAN 77 E 1 Sample FORTRAN 77 Program E 2 Analysis Output E 3 Statistics Output E 4 Call Tree E 5 Freeform Cross Reference E 6 Tabular Cross Reference Appendix F Diagnostic Messages F 1 Format F 1 Modifying the flint err file Appendix G Performance G 1 Disk Space G 1 1 Program Size G 1 2 Temporary Files Appendix H Xlint Installation Unix Linux H 1 Pre installation H 2 Installation Procedure H 3 Activation Procedure Appendix I Xlint Installation Under VMS I 1 Pre installation 1 2 Installation Procedure 1 3 Activation Procedure Cleanscape Software FortranLint Users Manual 123 123 124 127 127 128 130 133 133 134 137 138 138 140 143 143 144 145 145 145 145 147 147 147 149 151 151 151 153 Version 6 x 1 Introduction 5 1 VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV Introduction 1 1 Overview FortranLint is a programming tool that simplifies the debugging and maintenance of FORTRAN 77 Fortran 90 Fortran 95 and Fortran 2003 2008 programs FortranLint includes a source code analyzer that can detect a wide range
17. 5 1 Setting the Scope 43 5 2 Message Classification 43 5 3 Selecting Analysis Level 44 5 4 Suppressing Individual Messages 45 5 5 Portability Checking 46 5 6 Local Data Flow Analysis 46 Cleanscape Software FortranLint User s Manual Version 6 x Table of Contents 6 Analysis Output 6 1 Overview 6 2 Summary Mode 6 3 Output Details 6 3 1 Options and Filenames 6 3 2 Source Listing 6 3 3 Diagnostic Messages 6 4 Statistics Output 6 5 Exit Status 7 Call Trees 7 1 Overview 7 2 Tree Options 7 2 1 Arguments 7 3 Call Tree Format 7 3 1 Trimmed Trees 7 3 2 Condensing Multiple Calls 7 3 3 Sorting Alphabetically 7 3 4 Squished Trees 7 3 5 Graphic Character Set 7 4 Call Tree Content 7 4 1 Top Node 7 4 2 Undefined Routines 7 4 3 Library Routines 7 5 Recursion 7 6 Dummy Routines 7 7 Entry Points 7 8 Fortran 90 Internal Subprograms 8 Cross Reference 8 1 Overview 8 2 Layout 8 2 1 Program Routines 8 2 2 Block Data Routines 8 2 3 Subroutines and Functions 8 2 4 Modules F90 only 8 2 5 Common Blocks 8 2 6 Structures and Structure Components 8 2 7 Variables Arrays and Records 8 2 8 Parameters 8 2 9 Equivalences 8 2 10 High Performance Fortran HPF 8 3 Format Selection 8 4 Content Selection 9 Library Support 9 1 Overview 9 2 Writing Library Shell Files 9 3 Creating Library Template Files 9 4 Library Precedence 9 5 Miscellaneous Library Issues 9 5 1 Interaction with Cross Reference and Call Trees 9 5 2
18. 7 RS demo90 inc 9 R LOC R 4 10 private entity of M demo90 90 9 D module M OPDU I 4 local OUTER demo90 90 25 P 29 D 31 R 32 R STR CHAR 10 local MAI demo90 90 43 D 48 S STUDENT1 type TYPE S local MAI demo90 90 44 D 46 SA 47 SA 49 RA STUDENT2 type TYPE S local MAI demo90 90 44 D 46 RA 47 RA SUM R 8 8 local MAIN MAIN_INNER demo90 90 demo90 inc 5 D demo90 inc 5 I demo90 inc 8 R demo90 inc 9 S demo90 inc 9 R demo90 inc 10 R demo90 inc 13 R YPE1 type MYTYPE local M M INNER demo90 90 1 6 P 17 D 19 S OUTER demo90 90 25 P 28 D 32 S 34 S YPE2 type MYTYPE local M M INNER demo90 90 16 P 18 D 19 R OUTER demo90 90 25 P 28 D 32 R 34 R Cleanscape Software FortranLint User s Manual Version 6 x 132 Appendix D Sample Output FORTRAN 90 Parameters Name Type Kind Value Subprogram File References GRADE CHAR 2 6 MAIN demo90 90 48 R LEGEND Cleanscape Software NXNDUVOBAZEZRArPHOAAMUW BD actual argument used as an assumed array bound declaration equivalenced statement function dummy argument used as a label in a goto statement initialized initialized indirectly used as a label in an assign statement allocated nullified optional dummy argument dummy argument referenced set usage cannot be determined deallocated FortranLint User s Manual Version 6 x Appendix E Sample Output FORTRAN 77 C PROCDAT PROGRAM PROCDAT INTEGER IUNIT PUNIT
19. Disables or enables individual diagnostic messages Syntax O msg msg disables messages by number O msg msg enables messages by number O all disables all numbered messages O all enables all numbered messages O msg msg disable enable can be mixed V MS syntax SUPPRESS msg disables messages by number SUPPRESS msg enables messages by number SUPPRESS ALL disables all numbered messages SUPPRESS ALL enables all numbered messages disable enable can be mixed SUPPRESS msg msG Cleanscape Software FortranLint User s Manual Version 6 x 22 OUTPUT D escription Syntax VMS syntax See also D ssaiption Syntax VMS syntax P PORT D ssaiption Syntax VMS syntax Cleanscape Software 3 Command Reference VMS only Redirects output to a specified file Note use standard 1 O redirection flint gt foo out N A OUTPUT file S or SPLIT UNIX only Sends all source files through the C preprocessor Note FortranLint sends files with the F filename extension through the C preprocessor whether or not the p option is selected P N A Checks for portability issues related to one or more compilers or FORTRAN dialects In other words I plan to port my code to the specified compiler standard what issues will there be Supported environments include ANSI77 FORTRAN 77 NCU
20. Flint obtained from Cleanscape If it is decided that the severity of a Flint error message is too high or the error text is not descriptive enough for a particular application the flint err file may be modified using a standard text editor paying careful attention to existing format Cleanscape Software FortranLint Users Manual Version 6 x Appendix G Performance 145 Appendix G VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV Performance G 1 Disk Space G 1 1 Program Size On most systems FortranLint requires 1 MB to 6 MB of disk space for the package itself Additional space is required during analysis see below On Windows systems or Unix Linux systems with the G UI option the size may be up to 20 MB G 1 2 Temporary Files FortranLint generates temporary files during processing These files are auto matically deleted upon program termination including aborts The library function tempnam is used to obtain names for the temporary files On most systems the environment variable TMPDIR may be used to control the directory used by tempnam if TMPDIR is not set tempnam normally uses usr tmp or tmp For additional information see the UNIX man page for tempnam Under VMS temporary files are placed in the directory specified by SYS SCRATCH Generally speaking temporary files will require 2 MB or more of disk space for every 10 000 lines of
21. G enerate cross reference table Specify cross reference sub options G enerate call tree Specify call tree options Expand INCLUDE files G enerate source listing Specify message output format Set output page width Set output page length FortranLint User s Manual Version 6 x 32 3 Command Reference Other output control options B file L file S S file Miscellaneous options D definition E file M option preproc_path q 3 2 2 VMS Option Summary Source configuration options DLINES EXTEND FORM form LANG language NOI4 SY STEM system PATH path Diagnostic options ANSI FYI GLOBAL IMPLICIT PORT system SUPPRE SS number USAGE WARNINGS Cross reference options XREF XREF option Call tree options TREE TRE E option Progress summary mode implies S Create database fdb file Create library Ibt file Generate statistics Split output and redirect it D efine preprocessor level symbols Expand configuration file Miscellaneous options Preprocessor if different than cpp in SPATH Quit if no licenses are available Process debug lines Extend source width to 132 columns Specify Fortran 90 95 source form Specify language F77 or F90 95 Two byte integers and logicals Specify FORTRAN dialect Set search path for INCLUDE files Report non ANSI constructs Report FY
22. O internal Error number M Message content string Any other characters go into output string at that location Example Integration with Microsoft Visual Studio According to http blogs msdn com b msbuild archive 2006 11 03 msbuild visual studio aware error messages and message formats aspx a message in this format FortranLint User s Manual Version 6 x 3 Command Reference 21 filename line col Error 123 This is some text directed to its output window will be picked up automatically such that double clicking the message will cause VS internal editor to jump to the offending sourceline To accomplish this in Flint use the following command parameters o F L C SSTS SM W199 which output two lines first source then analysis message ISTAT PRINTIT CURITEM 1 c progra 2 cleanscape flint examples demo f 49 16 ERROR Interface 95 this name is defined as a subroutine N otes 1 On Unix Linux put the format string in single quotes to prevent command line parsing or escape any characters On Windows encasing in double quotes is recommended 2 Use w199 if your editor ID E expects message all on one line 3 At present the message text can only be output at the end If this is an issue email support cleanscape net Unix Syntax o message format Windows Syntax o message format V MS syntax N A O SUPPRESS D escription
23. demo in demo in demo in demo TYPE I 4 in demo in demo PROCDAT is Set Actual arg SETTYPE is Unused PRINT is Unused PRINTIT is Unused Fy Fh Fh Fh PROCDAT is Unused SETTYPE is Ref Set in demo f PRINT is Ref in demo f PRINTIT is Ref DIMENSIONS 3 R 4 in demo f PROCDAT is Set Actual arg in demo f SETTYPE is Ref in demo f PRINT is Unused in demo f PRINTIT is Unused mh Fh Fh Fh Fy Fh Fh Fh Records CURITEM struct ITEM local in demo f PROCDAT is Ref Set Actual arg in demo f SETTYPE is Dummy arg Ref Set Actual arg in demo f PRINT is Dummy arg Ref Actual arg in demo f PRINTIT is Dummy arg Ref Actual arg Vars Arrays COUNT I 4 bytes 0 3 of common BK2 in demo f PRINT is Ref CURITEM R 4 local in demo f DIPSTAT is Dummy arg Indeterminate Actual arg DIMS 3 R 8 local in demo f READNAME is Dummy arg Set T g ERA a local in demo f PROCDAT INUIT I 4 local in demo f PRINTIT is Set Actual argINUS common BLOCK is Ref Set I 2 bytes 0 1 cf Gl in demo f PRINTIT is Ref ISTAT I 4 local in demo f DIPSTAT is Dummy arg Set IUNIT I 4 local in demo in demo in demo CHAR 1 in demo PUNIT I 4 local in demo STATUS I 4 by
24. help screen similar to the following FORTRAN lint Usage Source configuration options d ze SL TP R V 2 9 path form sys Output control options 1 i s W Y S B K x t T num num file file opts opts Lowercase Uppercase 6 flint switches Rev 6 0 process debug lines 132 column source lines include file search path preprocess sources cpp source form select Fortran dialect two byte ints amp logicals set language to FORTRAN 77 set language to Fortran 90 source listing show include files statistics set page width set page length split output to files summary mode implies S create database fdb cross reference cross reference format content call tree call tree format content options may be combined use double dash to disable w or w o space options take parameters FortranLint is now ready for use file1 file2 file a f g m 0 u w num sys zG D E M opts defs file opts L za file Xhelp Thelp 15 Feb 2013 20 11 28 lbt file fdb Diagnostic options ANSI compatability report FYIs global processing flag implicit types omit selected messages portability issues data usage checking report warning dflt dflt Miscellaneous options generate Cadre data files defines for preprocessor expand file on cmmd line miscellaneous options Mhelp for
25. mode for this format is Xlinenumbers or XREF linenumbers VMS Xfreeform or XREF freeform VMS selects a more compact style with fields separated by single spaces The default line numbering mode for this format is Xnolinenum or XREF nolinenum VMS equiv noequiv By default the cross reference entry for a given variable includes usage informa tion for the associated equivalences whether or not the variable is used directly To suppress equivalence info use Xnoequiv or XREF noequiv VMS linenumbers nolinenum To produce cross reference tables with line numbers use Xlinenumbers or XREF linenumbers VMS To limit cross reference tables to the subprogram program unit level use Xnolinenum or XREF nolinenum VMS Note To be effective linenumbers or nolinenum must be specified after Xtabular Xfreeform X RE F tabular or XREF freeform on the command line legend nolegend If linenumbers is selected FortranLint prints single character usage codes along with line numbers A legend describing these usage codes is printed at the end To suppress the legend use Xnolegend or XREF nolegend VMS To restore the legend if it has been disabled use Xlegend or XREF legend VMS Note To be effective legend or nolegend must be specified after Xtabular Xfreeform XREF tabular or XREF freeform on the command line
26. nodename should be the appropriate node name or NO DECNET as explained in step 3 5 Copy the resource file XLINT DAT to the appropriate directory or directories Two logicals are used DECW SYSTEM DEFAULT System directory same for all users DECW USER DEFAULTS _ Per user directory To install a copy of XLINT DAT for system wide use place it in the directory specified by DECW SYSTEM_DEFAULTS To install a copy of XLINT DAT for use by an individual user place it in the directory specified by DECW USER_DEFAULTS for that user Note that users may an alternate resource file on the Xlint command line for additional information see section 15 3 6 Users are now ready to activate X lint Cleanscape Software FortranLint Users Manual Version 6 x Appendix I Xlint Installation Under VMS 153 1 3 Activation Procedure Every Xlint license must be assigned a unique authorization number activation key before the package will run 1 To proceed execute the following command FLINT LICENSE ACTIVATE The software will provide users with a server code and it will prompt them to call Cleanscape for activation Cleanscape will then use this information to provide them with a unique authorization number needed to run the software 2 After an activation key is obtained execute the command FLINT LICENSE ACTIVATE again and enter the activation code when prompted 3 If the license manager iptlmd hasn t already bee
27. 127 local variable INUIT is set but never referenced KKK KKK KKK KKK KK KKK KKK KKK KKK KK KKK KKK KKK KKK KH KH TH KH KK KH TH KH KH TH KH KH FH AH KK AH KK KH KK KH KK KK KH KH FH AH KH TH AH A KH KU KU Subroutine DIPSTAT File DEMO F Line 48 ISTAT PRINT CURITEM 1 EMO F DIPSTAT line 49 NTERFACE ERROR 95 this name is defined as a subroutine HOV V Cleanscape Software FortranLint User s Manual Version 6 x Appendix E Sample Output FORTRAN 77 137 KKK KKK KKK KKK KK KKK KKK KKK KKK KK KK KKK KK KK KH TH KH KK KH KH TH KH TH KH KH TH KH KH TH KH KK A KK KH KK KH KK KH TH AH KK A KK AH A KH KU KU Global checking Inconsistent organization of common BLOCK ref set checking suppressed for this common block USAGI USAGI E 3 Statistics gt gt gt Statistics ERROR 133 common block members referenced but not set BK2 COUNT FYI 135 unused common block members BK2 TIME Output Number of source files 1 Source files Include files Total parsed otal subprograms Subroutines Functions Program Block Data odule 50 lines 1276 bytes 6 comments 94 code 44 lines 1052 bytes 14 comments 86 code 94 lines 2328 bytes 10 comments 90 code 7 6 0 1 0 0 Individual message summary SYNTAX WARN 47 INTRFC ERR 56 INTRFC ERR 57 INTRFC ERR 59 INTRFC WARN 63 INTRFC ERR 95 INTRFC WARN 122
28. 90 files include demo90 for an F90 source file and demo90 fdb the associated database file demo90 for may be used to rebuild demo90 fdb Session 1 1 Under the FortranLint Xlint installation directory run xlint demo fdb This will bring up the X lint menu and analysis output for demo fdb 2 To find all symbols starting with I enter I in the Select field on the Control Panel and press lt Retum gt This will bring up cross reference information for all variables beginning with the letter I 3 To bring up information related to a specific symbol double click the appropriate line in the Cross Reference window For example to display information related to the variable IN UIT double click the following line INUIT I 4 variable in demo f 43 PRINTIT is Set Actual arg Cleanscape Software FortranLint User s Manual Version 6 x 14 Xlint Getting Started 95 The Source window should display demo for with line 43 containing INUIT highlighted The Tree window should display a tree centered around the PRINTIT routine The screen should appear similar to that shown in Figure 14 1 4 Double click another cross reference entry For example I I 4 variable in demo f 6 PROCDAT is Ref Note the changes in the Source and Tree windows Session 2 1 Run xlint This will bring up the X lint menu with four empty windows 2 Click on File in the upper left corner o
29. I messages Enable global processing Report implicit typing Enable portability checking Suppress individual error messages Check data usage Enable warnings Generate cross reference table Specify cross reference sub options Generate call tree Specify call tree sub options Cleanscape Software FortranLint User s Manual Version 6 x 3 Command Reference 33 Output format options INCLUDE LIST LPP number WIDTH number Other output control options DATABASE file LIBRARY ile OUTPUT file SPLIT file STATISTICS SUMMARY Miscellaneous options FILES file MISC option QUIT UNIXHELP or Expand INCLUDE files Generate source listing Set output page length Set output width Create database fdb file Create library Ibt file Redirect output to a specified file Split output and redirect it Generate statistics Progress summary mode implies SPLIT Expand configuration file Miscellaneous options Quit if no licenses are free Display UNIX letter options Cleanscape Software FortranLint User s Manual Version 6 x 34 3 Command Reference 3 3 Configuration Files Command line arguments may be specified indirectly using text files If bar txt is a text file containing option switches or filenames the following commands will add the contents of bar txt to the FortranLint argument list flint E bar txt foo f or flint FILE bar txt
30. INCLUDE demo inc DO 100 I 1 5 133 Appendix E VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV Sample Output FORTRAN 77 E 1 Sample FORTRAN 77 Program 50 CALL GETUNIT I 5 IUNIT PUNIT CALL READNAME CURITEM NAME CURITEM DIMENSIONS CALL SETTYPE CURITEM CALL PRINT CURITEM IUNIT 100 CONTINUE IF IUNIT EQ 23 GO TO 50 END C GETUNIT EGER UNIT UNIT1 UNIT1 UNIT Ina gt D UBROUTINE GETUNIT UNIT UNIT1 NAME DIMS END C SETTYP STATUS EAD 5 NAME DIMS CLUDE demo inc UBROUTINE SETTYPE CURIT E URITEM TYPE CURITE S T R N S C I COMMON BLOCK INUSE R R Y S I C I F CURITEM TYPE G M DIMENSIONS 2 5 CALL PRINT CURITEM UBROUTINE PRINT CURITEM IUNIT S INCLUDE demo inc IF CURITEM TYPE NE COUNT CALL PRINTIT IUNIT CURITEM SUBROUTINE PRINTIT I INCLUDE demo inc UNIT CURITEM IF IUNIT EQ INUSE THEN STATUS 2 CALL DIPSTAT 4 CURITEM CALL GETUNIT INUIT 3 END IF WRITE
31. P ansi90 or PORT ansi90 Note 1 To set the language mode use the 7 9 and or LANG switches Note 2 ANSI is limited to F77 or F90 Use 7 or 9 explicitly if you intend to perform ANSI checks Syntax a VMS syntax ANSI B DATABASE D escription Creates a specified database fdb file FortranLint and X lint use database files to regenerate call trees cross reference tables and diagnostic messages For additional information see chapter 13 Note FortranLint adds the fdb filename extension automatically Syntax B file V MS syntax DATABASE file d DLINES D escription Source lines starting with D in column one or Y for EPC code are debug lines By default debug lines are treated as comment lines If d or DLINES is specified FortranLint will process debug lines along with normal source code Note This option is valid only for fixed form code Syntax d V MS syntax DLINES Cleanscape Software FortranLint User s Manual Version 6 x D escription Syntax VMS syntax e EXTEND D ssaiption Syntax VMS syntax E FILES D ssaiption Syntax VMS syntax Cleanscape Software 3 Command Reference UNIX only Defines symbols for the C preprocessor Applies only if source files are preprocessed f filename extension or p option For additional information see section 4 3 D symbol value
32. R 4 PRINT The Source window now redisplays the source file with the highlight on PRINT in line 49 The Tree window shows a tree centered around DIPSTAT The Cross Reference window shows the following information PRINT subroutine in demo f 49 DIPSTAT is called 6 To see the lint summary again use the right mouse button to select Summary in the Lint window INCLUDE demo in pe COMETEN TEER m COUNT CALL PRINTIT TUNIT CURITEM C PRINTIT SUBROUTINE PRINTIT IUNIT CURITEM INCLUDE demo ine TF IUNIT BO IMUSE THEN CALL DIPSTAT A CURITEN ac Dierk CALL GETUNTT MIM 3 12w deprecated feature use derived types instead Tki sunbols vere implicitly tupsd as s Zu data type conversion 08 Ix branch irko do loop via label ix not ersuch arguments ix too mary arguments 1x constant is changed by mbprogram Ir expression is changed by subprogram Ax this name 15 defirad as 4 subroutine ix common block 8 organization differs at menber compared to initial use in routine VI Ren EROTA Sat Rd Fig 14 1 Xlint Window for Sample Sessions 1 and 2 Cleanscape Software FortranLint User s Manual Version 6 x 15 More About Xlint 97 15 VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV More About Xlint 15 1 Resizing Windows Any of the Source Lint Tree or Cross Reference windows in the X lint screen can be
33. To search for the next PRINT in demo for click the right mouse button anywhere in the Source window to call up the popup menu Select Next Text The next PRINT highlighted in the Source window is in the SETTY PE subroutine 4 To see all occurrences of PRINT use the right mouse button in the Cross Reference window to call up the submenu Choose Lookup Selected Symbol 5 To make across reference entry available as a selection for the Source and or Tree windows highlight the entry using a click of the left mouse button For example PRINT subroutine in demo f 33 PRINT is defined Cleanscape Software FortranLint User s Manual Version 6 x 15 More About Xlint 99 6 To see the tree related to this highlighted cross reference entry use the right mouse button to select the Routine Containing Xref in the Tree s popup menu The Tree window shows a call tree centered around the PRINT routine 7 To see where in the source code the highlighted PRINT in the Cross Reference window refers to use the right mouse button to select Current Xref in the Source window The highlight in the Source window now moves to the symbol PRINT in line 33 Note that the combined result of steps 5 7 can be done by simply double clicking the cross reference entry in step 5 8 lt Shift gt double click the SETTY PE routine in the Tree window The Source window moves the highlight to SETTY PE in line 27 T
34. UNIX example Xset variables Xno unref common arrays Xand init common var This will show set variables that are not unreferenced array common block members and any common block members that are initialized V MS example XREF routines and common blocks This will show routines and common blocks As mentioned previously the default conjunction is only The following combination will produce unexpected results Xused variables Xequivalenced variables or XREF used variables XREF eguivalenced variables under VMS If the intent is to produce a cross reference table with only variables that are used or eguivalenced the above command line option will not work The second argument eguivalenced variables will override the first argument used variables since the default conjunction is only The cross reference table produced by this option will only include equivalenced variables To perform the desired operation use Xused variables Xand equivalenced variables or XREF used variables XREF and equivalenced variables under VMS Because Flint generates a cross reference symbol table with all symbols used throughout the program a useful filter is to suppress local variables possibly being used as loop counters e g i To perform the desired operation use Xno local variables named Cleanscape Software FortranLint User s Manual Version 6 x 9 Library Support 73 9 VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
35. arguments INTRFC WARN 63 2x expression is changed by subprogran SYNTAX WARN 47 1x branch into do loop via label INTRFC ERR 56 1x not enough arguments INTRFC ERR 59 1x constant is changed by subprogram INTRFC ERR 95 1x this name is defined as a subroutine The number of messages is displayed last shown both in total and by category and severity The code lt supp gt meaning suppressed is shown for message categories and severities that were not selected Total messages 18 Errors Warnings FYIs Syntax 0 1 0 Interface 8 4 0 Data usage 2 1 2 Implicit typing lt supp gt Cleanscape Software FortranLint User s Manual Version 6 x 6 Analysis Output 51 6 5 Exit Status FortranLint retum status output is as follows On VMS systems 0x18000001 No errors warnings FYIs 0x18000003 FYIs produced 0x18000000 Warnings and FYIs produced 0x18000002 Errors and warning FYIs produced 0x18000004 Fatal errors caused FortranLint to terminate before completion On UNIX Linux and Windows systems No errors warnings FYIs FYIs produced Warnings and FYIs produced Errors and warning FYIs produced Fatal errors caused FortranLint to terminate before completion BwWN EF CO Note that that return status 0 1 or 2 indicates that FortranLint did not detect any errors with the specified options If Mnoexit is used FortranLin
36. arguments may be flagged with switches to provide additional information For additional information see the following text Example This sample stub provides FortranLint with a description of the standard UNIX exit routine treated as a subroutine subroutine exit status integer status end This stub provides FortranLint with a description of the standard UNIX library routine getcwd integer function getcwd dirname character dirname end As previously noted arguments may be flagged with switches to provide additional information For example subroutine exit status r integer status end integer function getcwd dirname s character dirname end Cleanscape Software FortranLint User s Manual Version 6 x 9 Library Support 75 The r switch used here asserts that exit references the status argument The s switch used here asserts that getcwd sets the dimame argument FortranLint takes this information into account when checking calls to these routines The following argument switches are supported 1 Lower case ell Asserts that the rest of the argument list starting with the flagged argument is option For example integer function grade name class1 1 class2 class3 character 40 name integer classl class2 class3 end This stub asserts that the function grade takes one required argument name followed by zero to three optional arguments class1 class2 and class3
37. characters to flag indirect calls i e calls to a routine which are made indirectly through the argument list of another routine 7 7 Entry Points The gt symbol in a call tree indicates that the call was made through an entry point For example ENTRPT gt SUB1 where ENTRPT is the entry point into subroutine or function SUB1 7 8 Fortran 90 Internal Subprograms Square brackets surrounding a routine name indicate that the routine is a Fortran 90 internal subprogram or a module subprogram MAIN M M INNER OUTER M MAIN_INNER Cleanscape Software FortranLint Users Manual Version 6 x 8 Cross Reference 61 8 VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV Cross Reference 8 1 Overview To generate a symbol table cross reference use the option x or XREF under VMS For sample cross reference output see Appendix D or E Cross reference tables can be generated from source files or from database files see chapter 10 The option switches X and XREF may be used to specify sub options that control the format and content of the cross reference table The UNIX cross reference format content sub options are Xfreeform Free form cross reference X no tabular Selects tabular format vs freeform X no equiv Selects equivalence usage information X no line Line resolution vs subprogram resolution X no le
38. demo f SETTYPE line 30 INTERFACE ERROR 56 not enough arguments KKK KKK KKK KKK KK KKK KKK KKK KKK KK KKK KKK KKK KKK KK KKK KKK KKK KKK KEK KKK KKK KKK KK KKK KKK KKK KKK Subroutine PRINTIT File demo f Line 38 gt CALL DIPSTAT 4 CURITEM gt N demo f PRINTIT line 42 INTERFACE ERROR 59 constant is changed by subprogram gt CALL DIPSTAT 4 CURITEM gt N demo f PRINTIT line 42 INTERFACE ERROR 248 struct ITEM passed to a R 4 dummy arg T demo f PRINTIT line 43 USAGE WARNING 127 local variable INUIT is set but never referenced KKK KKK KKK KKK KK KKK KKK KKK KKK KK KK KKK TH KH KK KH TH KH KK AH KK KH TH KH KH TH KH KH TH KH KK AH KK KH KK KH KK KH FH AH KK A KH AK AH A KH KU KU Subroutine DIPSTAT File demo f Line 48 gt ISTAT PRINT CURITEM 1 gt N demo f DIPSTAT line 49 INTERFACE ERROR 95 this name is defined as a subroutine KKK KKK KKK KKK KK KKK KKK KKK KKK KK KKK KKK KKK KKK KKK KK KK KKK KKK KKK KKK KKK KKK KKK KK KKK KKK KKK Global checking Inconsistent organization of common BLOCK ref set checking suppressed for this common block USAGI USAGI ERROR 133 common block members referenced but not set BK2 COUNT FYI 135 unused common block members BK2 TIME fl Fl Under VMS FortranLint Rev 4 30 2 Jan 02 10 49 55 Page 1 Local options WARNINGS USA
39. enlarged or reduced at the expense or benefit of the other windows To resize a window press the left or middle mouse button on the small box between two windows and drag it to the new boundary line users desire Then release the button When the information in any of the windows exceeds the size of the window a scroll bar will appear on the bottom and or right hand side of the window 15 2 Window Interaction Window interaction is controlled by the Action sub menu in each of the Lint Tree and Cross Reference windows The settings in these Action menus determine how changes in that particular window will affect the other windows Depending on the action settings all the windows may be updated to reflect information relative to the changed window To view or change the action settings for a particular window move the mouse cursor to any location within that window and press the right mouse button The popup menu for that window will now be displayed Move the mouse to the Action option and press the right button again The action options will now be displayed To toggle an option on or off simply point to that option box and press the right mouse button The default settings for window interaction are set so that an action in any window will affect the others For example if the user double clicks a cross reference entry the corresponding source code and the tree information will appear in the Source and Tree windows 15 3 Command Li
40. except in the event of changing the hostname of the current machine host can be overridden by the environment variable FLINTHOST For the daemon hostname there are two special values 1 a causes a system wide search for the daemon 2 a causes an error to be reported unless FLINTHOST is set c The preprocessor parameter allows FortranLint to pass the source code through a preprocessor usually cpp before analyzing it The preprocessor must take the same arguments as cpp d The bootfile parameter sets the name of the boot file which can optionally be modified during the activation procedure to automatically start the license daemon when rebooting the system Cleanscape Software FortranLint User s Manual Version 6 x Appendix B Installation Under VMS 113 Appendix B VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV Installation Under VMS B 1 Pre installation Starting with revision 2 82 FortranLint incorporates a license manager that requires a detached process to be loaded before the product will run The daemon is called iptlm for versions below 2 90 and iptlmd for versions 2 90 and above Installation can be done by non privileged users However root privileges are required if the product is to be installed in system directories Note The FortranLint installation directory mentioned in the following sections is the directory that contains the FortranLint
41. information see chapter Note This option causes FortranLint to run in a special mode bypassing normal analysis Consequently input files must be free of errors before this option is used Syntax L file Ibt VMS syntax LIBRARY filelbt Cleanscape Software FortranLint User s Manual Version 6 x Example LPP See a m IMPLICIT D escription Syntax VMS syntax M MISC D escription Cleanscape Software 3 Command Reference 19 flint L vmslib lbt vmslib lsh flint LIBRARY mylib lbt mylib for under VMS Reports the use of implicit data typing m IMPLICIT F90 only Miscellaneous options ansi maxloc Modifies the rules used for HPF checking For additional information see section 4 9 depend If this sub option is specified Fortran 90 source file order is irrelevant Note This sub option adds an extra pass which reduces processing speed slightly depend filename FortranLint will output the sorted file list and the file dependencies via USE association to the specified file The filename extension dep is added automatically If the source files are in order depend is not required help Outputs a help screen describing these sub options hpf Enables HPF checking For additional information see section 4 9 ignore log Ignore VMS logicals inside INCLUDE statements Useful when VMS Fortran files are processed under Windows or UNIX To specify the INCLUDE directories which s
42. installer 2 Command line setup If you d like to use the command line version of FortranLint two follow the steps outlined in Part 1 then two additional steps are required a Set the environment variable FLINTHO ME as follows SET FLINTHOME C CLEANSCAPE FLINT MAIN Cleanscape Software FortranLint User s Manual Version 6 x 106 Appendix A Installation b Modify PATH as follows PATH FLINTHOME PATH Note Under Windows 98 you may need to add double quotes as follows PATH FLINTHOME PATH 3 License Manager Most Windows users are licensed as single user node locked For these users no license setup required other than obtaining a key as described in Section A 3 If you have obtained floating licenses setup of a license service is required and there are setup steps on the clients Instructions may be found in file readme floating txt installed by default to directory C Cleanscape FLINT Doc 4 Documentation For more information see the following two documents flintman pdf Main FortranLint manual PDF format flintgui pdf Covers the FortranLint GUI PDF format The installer copies these files to the following directory C Cleanscape FLINT Doc A 1 Pre installation for Unix Linux Starting with revision 2 81 FortranLint incorporates a license manager that requires a daemon to be loaded before the product will run The daemon is called iptlm for versions below 2 90 and iptlmd for versi
43. more info library generation mode do not wait for license for more info for more info w and do not combine Note At this point Xlint may be installed For additional information see Appendix H A 4 Patching FortranLint Unix Linux only Some of the default parameters in FortranLint can be modified within the FortranLint executable This is accomplished using the flpatch program This program takes the following command line arguments 1st name of the executable required 2nd parameter to patch 3rd desired value If the second or third arguments are not given the user will be prompted for them Cleanscape Software FortranLint User s Manual Version 6 x Appendix A Installation 111 The patchable parameters in FortranLint are Name Description Default value home installation directory usr local flint host license server host preprocessor path of C preprocessor usr lib cpp bootfile system boot file etc rc local a The home parameter sets the default for the directory of the FortranLint support files home can be overridden by the environment variable FLINTHOME b The host parameter is used by the license manager to locate the machine on which the license manager daemon is running This helps improve performance since the application does not have to search the entire network for the location of the daemon This parameter is set during the installation procedure and need not change
44. must create a project database or fdb file For additional information see chapters 10 and 13 To run the browser enter the command xlint xlint The X lint menu will appear along with four empty windows Next use Load Database on the File sub menu to load the appropriate database For additional information see section 13 2 Cleanscape Software FortranLint User s Manual Version 6 x 94 14 Xlint Getting Started After the fdb file is loaded source analysis output will appear in the Lint window To display all lint messages scroll through the lint message summary To display all occurrences of a given message double click the message The Lint window will be updated appropriately For detailed information on a given occurrence double click the occurrence Xlint will display related source code call tree output and cross reference information For on screen help click the left mouse button on the Help field in the upper right comer of the X lint screen To load another database select Load Database on the File menu To exit X lint select Quit on the File menu 14 3 Sample Sessions The FortranLint X lint package includes sample FORTRAN 77 and Fortran 90 project files The sample FORTRAN 77 files include demo for an F77 source file and demo fdb the associated database file demo for may be used to rebuild demo fdb for additional information see section 13 2 Similarly the sample Fortran
45. options along with where they were specified e Default options are options that were specified in the flint cfg configuration file in the installation directory These are the system defaults e User options are options that were specified in a flint cfg configuration file in the directory named in the environment variable FLINTCFG These are a users custom defaults e Local options are options that were specified in a flint cfg configuration file in the local directory These are usually the defaults for a specific project e Expanded options are options that were specified in a configuration file expanded onto the command line with the E or FILES option e Command options are options that were placed on the command line The selected source file names are shown next grouped by directory A source listing follows if requested along with diagnostic messages Cleanscape Software FortranLint Users Manual Version 6 x 6 Analysis Output 49 6 3 2 Source Listing To produce a source listing use the I dash ell option or LISTING under VMS By default the listing does not expand include files To expand include files use the i option or INCLUDE under VMS 6 3 3 Diagnostic Messages FortranLint generates a diagnostic message for each problem detected within a subprogram program unit Each message includes the source line and a pointer to the column where the problem appears Also shown are the na
46. or in configuration files FortranLint understands several different source formats In FORTRAN 77 mode 7 or LANG F77 option FortranLint assumes AN SI standard fixed format with a continuation indicator at column 6 and a comment field starting at column 73 To process FORTRAN 77 code that extends past column 72 add the option e or EXTEND under VMS In Fortran 90 95 03 mode 3 9 or LAN G F03 F90 options sources may use either free format or FORTRAN 77 fixed format Variable position comments starting with may be used in either fixed or free format FORTRAN 77 style comments starting with a C in column 1 may be used only in fixed format Free format lines may contain up to 132 characters TAB formatting is supported for target environments that allow it i e if the label field contains a TAB character processing skips to the first non blank character If that character is a non zero digit the source line is treated as a continuation line otherwise the line is treated as a statement TAB formatted lines may be intermixed with normal fixed format lines FortranLint normally distinguishes between free format files and fixed format files based on filename extension By default f90 files are assumed to be free format and other files are assumed to be fixed or TAB format To override the default setting use the R option or the FORM option under VMS For additional information see c
47. page length of Zero The default value is zero for console output and 60 lines per page if 5 OUTPUT SPLIT and or SUMMARY are used to redirect output Y number LPP number On most systems integers and logicals are four bytes long by default If 2 or NOIA is used FortranLint interprets INTEGER and LOGICAL as INTEGER 2 and LOGICAL 2 Additionally integer and logical constants are treated as two byte values unless they are too large to fit into the smaller size 2 NOI4 This option may be used to specify the input language FO RTRAN 77 Fortran 90 95 or Fortran 2003 7 Selects FORTRAN 77 9 Selects Fortran 90 95 3 Selects Fortran 2003 LANG F77 Selects FORTRAN 77 LANG F90 Selects Fortran 90 95 LANG F03 Selects Fortran 2003 FortranLint User s Manual Version 6 x 3 Command Reference 29 Note Specify 7 or 9 explicitly if you intend to perform ANSI a checks ANSI checking is limited to F77 or F90 only D escription not VMS Specifies the path to the preprocessor directory NOTE Under Unix Linux the default is usr lib Syntax preprocessor path SUMMARY D escription The command line option or SUMMARY under VMS combines three operations a This option displays a progress meter that tracks the progress of FortranLint in real time b It redirects FortranLint output as explained in section 2 3 1 By default or SUMMARY
48. product is not yet installed b The host parameter is used by the license manager to locate the machine on which the license manager detached process is running If the license manager is not installed on a DECNET server this parameter should be set to NO DECNET The host parameter can be overridden by setting the logical FLINTHOST For the detached process hostname there are two special values 1 a causes a system wide search for the detached process 2 a causes an error to be reported unless FLINTHO ST is set Cleanscape Software FortranLint User s Manual Version 6 x 118 Appendix B Installation under VMS Cleanscape Software FortranLint User s Manual Version 6 x Appendix C License Manager 119 Appendix C VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV License Manager Starting with version 2 81 FortranLint incorporates a license manager that requires a daemon to be loaded before the product will run This daemon is called iptlm for versions below 2 90 and iptlmd for versions 2 90 and above Most of the information here is relevant for non Windows users C 1 License Manager Commands C 1 1 User Commands 1 By default FortranLint will queue a job when there are no more licenses available The q option or quit under VMS when added to the flint command line will force the application to quit when there are no available licenses flint q op
49. redirects the output to files named flint Int flint tre etc S or SPLIT may be used to specify a different base name c It displays an error message summary as described in section 2 3 2 Syntax V MS syntax SUMMARY UNIXHELP D escription VMS only Displays FortranLint s letter option switches This option is not supported To display the letter switches execute flint with no parameters For additional information see section 3 1 2 V MS syntax or UNIXHELP Cleanscape Software FortranLint User s Manual Version 6 x 30 3 Command Reference 3 1 4 Using UNIX Switches Under VMS FortranLint s letter option switches letter can be also used under VMS Letter switches can be used inside flint configuration files with no special rules or restrictions However if letter switches are used on the VMS command line three rules apply a letter switches do not include white space b letter switches are limited to one argument per switch c upper case switches must be double quoted For example the following VMS flint commands are equivalent flint PORT sgi foo for flint Psgi foo for To specify multiple arguments for a letter switch on the VMS command line use multiple copies of the switch For example the following commands are equivalent flint TREE condensed nolibrary foo for flint Tcondensed Tnolibrary foo for
50. select a different compiler use the V option or SYSTEM under VMS and specify a dialect code from section 4 5 or 4 6 For option syntax see chapter 3 To flag code that is not supported by a specific dialect use P or PORT under VMS instead 4 8 Default Sizes On most systems integers and logicals are four bytes long by default To change the default size use the option 2 or NOIA under VMS If either of these options are selected FortranLint interprets INTEGER and LOGICAL as INTEG ER 2 and LOGICAL 2 Additionally integer and logical constants are treated as two byte values unless they are too large into fit into the smaller size Cleanscape Software FortranLint User s Manual Version 6 x 42 4 Command Reference 4 9 High Performance Fortran HPF FortranLint supports High Performance Fortran HPF By default HPF statements are treated as normal comments To enable HPF checking use the option Mhpf or MISC hpf under VMS To add HPF processors and templates to a cross reference enable HPF checking and select linenumbers or tabular output format use Mhpf Xlinenumbers or Mhpf Xtabular Under VMS use MISC hpf XREF linenumbers or MISC hpf XREF tabular For additional information on the linenumbers and tabular formats see section 8 3 For non DEC target systems FortranLint normally checks argument lists for MAXLOC and MINLO C using the following rules MAXL
51. source code Cross reference tables and call trees will increase the amount of disk space required Cleanscape Software FortranLint User s Manual Version 6 x Appendix H Xlint Installation 147 Appendix H VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV Xlint Installation Unix Linux H 1 Pre installation The Xlint installation procedure assumes that FortranLint has already been installed and activated If FortranLint has not been installed see the instructions in A ppendix A Note The FortranLint Xlint installation directory mentioned in the following sections is the directory that contains the FortranLint Xlint support files for example flint err and flint cfg H 2 Installation Procedure 1 Log in as system manager 2 Go to the FortranLint Xlint installation directory The following Xlint support files should already be present xlint Xlint executable X Lint X lint resource file demo fdb demo database generated from demo f 3 Modify the user configuration for each X lint user as follows a Set the environment variable XLINTHOST to the host name of the system where the Xlint license manager will be running To obtain the host name execute the UNIX command hostname on the server b Set the environment variable XLINTPATH to a full path for the directory which contains the user s own FORTRAN source files c Set the environment variable XLINTH
52. support files for example flint err and flint cfg B 2 Installation Procedure 1 2 Log in as system manager Create an installation directory Go to the new directory Load the tape or other media provided and execute commands of the following form MOUNT FOR device name BACKUP LOG device name FLINT DISMOUNT device name where device name is the VMS device name for the media used TK 50 cartridge tape 1600 bpi mag tape etc Step 3 will load a number of files including DEMO FOR demo source files DEMO INC demo include file DEMO90 F90 demo90 source files DEMO90 INC demo90 include file FLINT CFG FLINT default configuration file FLINT ERR error message text FLINT HLP FLINT help file use with VMS HELP FLINT HLS FLINT help file command line options VMSLIB LSH standard VMS library description text VMSLIB LBT standard VMS library file UNIXLIB LSH standard UNIX library description text UNIXLIB LBT standard UNIX library file Cleanscape Software FortranLint User s Manual Version 6 x 114 Appendix B Installation under VMS The basic executables include loaded DEMO COM demo script DEMO90 COM demo90 script IPTLMA EXE license administration program IPTLMD EXE license manager detached process IPTLMR EXE license usage report generator FLINT EXE FortranLint executable FLPATCH EXE executable patch program If the X lint option was purchased the following additional files will be DEMO FDB database fil
53. the many options available within this product 12 1 Screen Layout The X lint screen is made up of four windows and a control panel See Figure 12 1 The four windows from top to bottom are Source Lint Tree and Cross Reference They are used to display specific information relating to the current database being analyzed When information in any of the windows exceeds the size of the window a scroll bar will appear on the bottom and or right hand side Each window can be enlarged or reduced at the expense or benefit of the other windows The Control Panel bar between the Source and Lint windows contains a text input field and three buttons Popup menus are supported by all four windows and can be called up by a click of the right mouse button with the pointer anywhere in the appropriate window Options in the popup menus can be selected by simply holding down the right button dragging the pointer to the desired option and then releasing the button When the button is released the option will be set and the menu will disappear On screen help is available A help menu can be called up by a click of the left mouse button on the help option at the top of the X lint screen Cleanscape Software FortranLint User s Manual Version 6 x 84 12 Learning About Xlint Source Control Panel Lint Info Call Tree Cross Reference Fig 12 1 Xlint window on startup Cleanscape Software FortranLint User s Manual Version 6
54. the system that will be running the X lint license manager Note The install flint shell script runs flpatch automatically flpatch therefore should be needed only if one of these parameters changes Copy the XLint resource file XLint to the appropriate directory or directories A copy of this file should be placed in the home directory for each X lint user By default X lint uses this copy Users may specify alternate versions on the X lint command line for additional information see section 15 3 Alternatively users may set the standard environment variable XAPPL RESDIR or use the standard app defaults directory For additional infor mation see the operating system vendor s X documentation Users are now ready to activate X lint Cleanscape Software FortranLint User s Manual Version 6 x Appendix H Xlint Installation 149 H 3 Activation Procedure Every Xlint license must be assigned a unigue authorization number activation key before the package will run i To proceed execute the following command xlint activate The software will provide users with a server code and it will prompt them to call Cleanscape for activation Cleanscape will use the server code to generate a unique authorization number for the software 2 After an activation key is obtained execute the command xlint activate again and enter the activation key when prompted 3 If the license manager process iptlmd has not already been start
55. to the user s search list For csh users use a command of the form set path path FLINTHOME For sh users use a command of the form PATH FLINTHOME PATH To make the changes permanent add the new commands to the appropriate login scripts For example for csh users modify cs Optional The FortranLint package includes a utility program named flpatch that can be used to patch the FortranLint installation directory and server host name directly into the flint executable To patch the executable use commands of the form flpatch flint host hostname flpatch flint home installation directory For additional information on FLPATCH see section A 4 Users are now ready to activate FortranLint Cleanscape Software FortranLint User s Manual Version 6 x Appendix A Installation 109 A 3 Activation Procedure Unix Linux Windows Every FortranLint license must be assigned a unigue authorization number or activation key by Cleanscape before the package will run 1 To proceed execute the following command flint activate The software will provide users with a server code and it will prompt them to call or email Cleanscape for activation If users have not already received an activation key they will need to contact Cleanscape Cleanscape will then generate an activation key based on the server code 2 Once the activation key is acquired execute the following command flint activate again and enter the activati
56. undefined and unused blocks Common blocks structures variables Includes scalars arrays and records scalars Single valued variables arrays records Structured records parameters Defined in parameter statement 5 The symbol name is specified last This is composed of two words the word named followed by the actual symbol name The following wildcards are allowed matches zero or more characters matches one character Wildcards may be combined Example Xnamed ab f h or XREF named ab f h under VMS The default content of the cross reference table is everything except unused common variables and unreferenced parameters UNIX examples Xno intrinsic Suppress intrinsic functions Xuncalled routines Only routines that have not been called Xand unused parameters Show unused parameters too Xno unused common variables Don t show declarations of common variables where they are unused if a symbol is never used its name does not appear Cleanscape Software FortranLint User s Manual Version 6 x 8 Cross Reference 71 V MS examples XREF routines Only show routine names XREF no common Suppress common blocks and common block members XREF unset functions Show only undefined functions XREF unused dummy arrays Show array dummy arguments that are unused Multiple phrases may be given these are checked in order from left to right The phrases may be either on the same option or on separate options
57. using the order in which routines were called If alphabetical is used sub trees are displayed in alphabetical order alphabetical may be abbreviated to alpha To restore the default mode of operation use T noalpha or TREE noalpha condensed Merges multiple calls to the same routine To restore the default mode of operation use T nocondensed or TREE nocondensed graphics xxx Changes the graphics characters used to print the call tree For additional information see section 7 3 5 head symbol Generates a call tree starting at the specified symbol FortranLint User s Manual Version 6 x Syntax VMS syntax u USAGE D ssaiption Syntax VMS syntax Cleanscape Software 3 Command Reference 25 help Displays a help screen describing the call tree options No processing is done if this sub option is selected nolibrary Suppresses calls to routines defined in libraries i e Jbt files For additional information see section 7 4 3 and chapter 9 noundefined Suppresses calls to undefined routines squish To improve readability FortranLint normally adds extra white space to call trees squish removes the extra Space To restore the default mode of operation use T nosquish or TREE nosguish trim This sub option merges redundant sub trees to reduce the size of the output The configuration file shipped with FortranLint enables trim by default To disabl
58. will be used This allows FortranLint to resolve ambiguous extensions constructs that look similar but are handled differently in different environments Supported environments include ANSI77 FORTRAN 77 NCUBE ANSI90 Fortran 90 OS32 Concurrent CRAY SGI CVF Compag Visual Fortran SUN HPUX TRU64 EPC VAXULTRIX LAHEY Windows Linux VMS For additional information see sections 4 5 through 4 7 V system SY STEM systan Enables warning messages The configuration file shipped with FortranLint enables this option by default To disable warnings use w or NOWARNINGS W WARNINGS FortranLint User s Manual Version 6 x W WIDTH D escription Syntax VMS syntax x XREF D escription Syntax VMS syntax X XREF D escription Cleanscape Software 3 Command Reference 27 Sets output width in columns This option affects all output including diagnostic messages and cross reference tables Any value between 40 and 500 may be used the default width is 80 columns Under VMS the default width is 80 columns unless OUTPUT is used in this case the default width is 132 columns W number WID TH number Generates a cross reference table For cross reference format options see X or XREF For additional information on cross reference tables see chapter 8 X XREF or XREFERENCE Sets cross reference sub options and generates a cross reference tab
59. 48 USAGE WARNING 127 local variable STR is set but never referenced KKK KKK KKK KKK KK KKK KKK KKK KK KKK KKK KKK KKK KKK KH KK KH KK KH KK KH TH KH KH TH AH KK A KK KH KK KH TH AK KH TH AH KK A KH AK AH A KH KU U Function MAIN_INNER File demo90 90 Line 53 lt Internal subprog of MAIN gt KKK KKK KKK KKK KK KKK KKK KKK KKK KK KKK KKK KKK KK KKK KKK KKK KH KH KK KH FH KH KK A KH TH KH KK KH TH KH KK KH KK AH KH TH AH A KH KU KU Global checking T USAGE WARNING 743 module entity set but not referenced M AV Gl T USAGE FYI 744 unused module entity M LOC Under VMS FortranLint Rev 4 30 2 Jan 02 10 49 55 Page 1 T Local options WARNINGS USAGE SUPPRESS 207 276 76 261 NOTR Command options FYI GLOBAL STATISTICS OUTPUT demo90 E NOXREF DEMO90 F90 403 KKK KKK KKK KKK KK KKK KKK KKK KKK KK KKK KKK KKK KKK KH KK KH KK KH KK KH TH KH KH TH AH KK KH KK AH KK KH TH KH KH TH KH KK AH KH KH AH A KH KU KU Subroutine M_INNER File DEMO90 F90 Line 16 lt Module subprog of M gt gt TYPE1SNAME ALIAS TYPE243NAME gt ae DEMO90 F90 M INNER line 19 SYNTAX FYI 105 string will be truncated from 17 to 10 chars KKK KKK KKK KKK KK KKK KKK KKK KKK KK KKK KKK KK KKK KKK KKK KKK KKK KKK KEK KKK KKK KKK KKK KKK KKK KKK KU KU Subroutine OUTER File DEMO90 F90 Line 25 gt TYPE1 SCORES 1 1 TYPE2
60. AVI i MAIN INNER STUDENT1 SCOR A 090 F90 MAIN line 49 TERFACE RROR 252 I 4 array passed to dummy arg which is a R 4 array E un T HUV V z U EMO90 F90 MAIN line 46 USAGE ERROR 126 local variable STUDENT2 is referenced but never set DEMO90 F90 MAIN line 48 USAGE WARNING 127 local variable STR is set but never referenced KKK KKK KKK KKK KKK KKK KK KKK KKK KK KKK KKK KKK KKK KH KK KH KK KH TH KH KH KK KH FH AH KK AH KK KH TH KH KH KK KH TH KH KK AH KH KH AH A KH KU KU Function MAIN_INNER File DEMO90 F90 Line 53 lt Internal subprog of MAIN gt KAKKAKKAKRKKKAKRKAKKRAKKH KK KK KK KKK KKK KKK KK TH KH KK AH KK KH KK KH TH KH KH TH KH KK AH KK KH KK KH KK KH TH KH KK AH KK AH A KH KU KU Global checking T USAGE WARNING 743 module entity set but not referenced M AV Gl USAGE FYI 744 unused module entity M LOC T Cleanscape Software FortranLint Users Manual Version 6 x Appendix D Sample Output Fortran 90 127 D 3 Statistics Output gt gt gt Statistics Number of source files 1 Source files 54 lines 1273 bytes 18 comments 82 code Include files 14 lines 352 bytes 53 comments 953 code Total parsed 68 lines 1625 bytes 153 comments 853 code Total subprograms 5 Subroutines 2 Functions T Program 1 Block Data 0 odules 1 Individual message summary
61. BE ANSI90 Fortran 90 OS32 Concurrent CRAY SGI CVF Compaq Visual Fortran SUN HPUX TRU64 EPC VAXULTRIX LAHEY Windows Linux VMS For additional information see sections 4 5 through 4 7 NOTE Modern compilers often offer extensions ranging from F90 to F03 e g Sun s compiler for F95 offered the BIND command so in general Flint will work best by not specifying portability options If you have a particular issue with your compiler please email support cleanscape net P system PORT ABILITY system FortranLint User s Manual Version 6 x q QUIT D escription Syntax VMS syntax R FORM D escription Syntax VMS syntax s STATISTICS D ssaiption Syntax VMS syntax See also S SPLIT D ssaiption Cleanscape Software 3 Command Reference 23 This option is related to FortranLint s license manager see Appendix C By default FortranLint waits for a free license if none is available If q or QUIT is specified FortranLint terminates immediately in this case q QUIT When Fortran 90 sources are processed FortranLint normally determines the source format fixed or free based on the filename extension R or FORM may be used to specify the source format explicitly For additional information see section 4 1 Note This option does not apply to FORTRAN 77 code R fixed Specifies fixed form R free Specifies free form FORM fi
62. Cross Reference window Current Xref Goes to the text referred by the cross reference entry currently highlighted in the Cross Reference window Next Xref Goes to the text referred by the cross reference entry one after the current highlight in the Cross Reference window Previous T ext Goes to the previous occurrence of the text currently highlighted in the Source window Next Text Goes to the next occurrence of the text currently highlighted in the Source window Cleanscape Software FortranLint User s Manual Version 6 x Lint Tree 12 6 Lint Window 12 Learning About Xlint 87 Goes to the text referred by the lint message currently highlighted in the Lint window Note If the Lint window is currently in the summary mode the cursor in the Source window will not be affected Goes to the function or subroutine currently highlighted in the Tree window The current FortranLint analysis messages pre generated by FortranLint are displayed in this window When a database is initially loaded asummary of the FortranLint source analysis is shown Double clicking an item in the summary calls up the actual instances of that message Double clicking a message instance causes lookups in the other windows specified for action in Lint s popup menu Summary All Messages Action Cleanscape Software Shows a summary of FortranLint analysis output Example IMPLCT 125 7x symbols were implicitly typed as where 7
63. E subroutine demo line 27 1 struct ITEM RS 30 PRINT PROCDAT demo f 8 Common blocks Name size Members Consistency References BK2 8 COUNT TIME model PROCDAT same SETTYPE PRIN PRINTIT BLOCK 6 INUSE STATUS model PROCDAT same READNA SETTYPE PRINT PRINTIT Cleanscape Software FortranLint User s Manual Version 6 x Appendix E Sample Output FORTRAN 77 141 Structures Fields Name size Field Type Kind Attributes Subprogram File References ITEM 26 NAME CHAR 10 PROCDAT demo f demo inc 3 D 7 SA SETTYPE demo f demo inc 3 D PRINT demo f demo inc 3 D PRINTI demo f demo inc 3 D TYPE I 4 PROCDAT demo f demo inc 4 D SETTYPE demo f demo inc 4 D 29 5 30 R PRINT demo f demo inc 4 D 35 R PRINTI demo f demo inc 4 D 45 R DIMENSIONS R 4 3 PROCDAT demo f demo inc 5 D 7 SA SETTYPE demo f demo inc 5 D 29 R PRINT demo f demo inc 5 D PRINTI demo f demo inc 5 D Vars Arrays Name Type Kind Attributes Subprogram File References COUNT I 4 bytes 0 3 of PRINT demo f demo inc 9 D demo inc 11 D 35 R common BK2 CURITEM struct ITEM local PROCDAT demo f demo inc 7 D 7 SA 7 SA 8 RSA 9 RA SETTYP demo f 27 P demo inc 7 D 29 5 29 R 30 R 30 RA PRINT demo f 33 P demo inc 7 D 35 R 35 RA PRINTI demo f 38 P demo inc 7 D 42 RA 45 R CURITEM R 4 local DIPSTA demo f 48
64. File Format Cleanscape Software FortranLint Users Manual Version 6 x Table of Contents 10 Database Files 10 1 Overview 10 2 Creating Database Files 10 3 Using Database Files 10 4 Using FDB files as libraries 11 Xlint Introduction 12 Learning About Xlint 12 1 Screen Layout 12 2 File Menu 12 3 Search Menu 12 4 Build Menu 12 5 Source Window 12 6 Lint Window 12 7 Tree Window 12 8 Cross Reference Window 12 9 Control Panel 12 10 Mouse Functions 13 Database Files and Xlint 13 1 Overview 13 2 Loading Database Files 13 3 Rebuilding Database Files under Xlint 14 Xlint Getting Started 14 1 Configuration Setup 14 2 Running Xlint 14 3 Sample Sessions 15 More About Xlint 15 1 Resizing Windows 15 2 Window Interaction 15 3 Command Line Options 15 4 Advanced Example 16 Xlint Resource Files 16 1 Overview 16 2 Xlint and XLINT DAT Appendix A Installation Windows Unix Linux A 0 Windows Installation A 1 Pre installation for Unix Linux A 2 Installation Procedure Unix Linux A 3 Activation Procedure Unix Linux Windows A 4 Patching FortranLint Unix Linux only Appendix B Installation Under VMS B 1 Pre installation B 2 Installation Procedure B 3 Activation Procedure B 4 Patching FortranLint Appendix C License Manager C 1 License Manager Commands C 1 1 User Commands C 1 2 Administrative Commands C 1 3 License Manager Options at daemon startup only Cleanscape Software FortranLint User s Manual 105 105 106 106
65. GE SUPPRESS 207 276 76 261 NOTREE NOXREF Command options FYI GLOBAL STATISTICS OUTPUT demo LANG f77 DEMO F 403 KKK KKK KKK KKK KK KKK KKK KKK KKK KK KKK KKK KK KKK KKK KKK KKK KK KKK KKK KKK KKK KKK KK KKK KKK KKK KKK Program PROCDAT File DEMO F Line 2 50 CALL GETUNIT I 5 IUNIT PUNIT A EMO F PROCDAT line 6 NTERFACE WARNING 63 expression is changed by subprogram HO VV 50 CALL GETUNIT I 5 IUNIT PUNIT EMO F PROCDAT line 6 NTERFACE ERROR 57 too many arguments H DO VV Cleanscape Software FortranLint User s Manual Version 6 x 136 Appendix E Sample Output FORTRAN 77 CALL READNAME CURITEM NAME CURITEM DIMENSIONS A gt gt DEMO F PROCDAT line 7 INTERFACE ERROR 252 R 4 array passed to dummy arg which is a R 8 array CALL READNAME CURITEM NAME CURITEM DIMENSIONS A gt gt DEMO F PROCDAT line 7 INTERFACE ERROR 287 R 4 array passed to R 8 array of larger size by 12 gt IF IUNIT EQ 23 GO TO 50 gt N DEMO F PROCDAT line 11 SYNTAX WARNING 47 branch into do loop via label 50 U EMO F PROCDAT line 6 USAGE ERROR 126 local variable IUNIT is referenced but never set DEMO F PROCDAT line 3 USAGE FYI 128 local variable PUNIT declared but unused KKK KKK KKK KKK KK KKK
66. INT DAT X lint resource file DEMO FDB demo database file for demo for 3 Modify the user configuration for each X lint user as follows a If the Xlint license manager is installed on a DECNET server set the logical XLINTHOST to the node name for the server Otherwise set XLINTHOST to NO_DECNET Note To obtain the node name execute the command show logical SYS NODE on the server Discard any colon characters b Set the logical XLINTPATH to a full path for the directory which contains the user s own FORTRAN source files c Set the logical XLINTHOME to a full path for the Xlint installation directory Cleanscape Software FortranLint User s Manual Version 6 x 152 Appendix I Xlint Installation Under VMS d Set the logical XLINT to a full pathname for the executable file XLINT EXE in the installation directory Add the new commands to the appropriate login com files E xample define XLINTHOST nodename define XLINTPATH source_path define XLINTHOME installation_directory XLINT XLINTHOME XLINT EXE 4 Optional The FortranLint package includes a utility program named FLPATCH EXE that can be used to patch the Xlint installation directory and server node name directly into the Xlint executable file To patch Xlint use commands of the form FLPATCH XLINT EXE HOME disk directory path FLPATCH XLINT EXE HOST nodename disk diredory path should specify the Xlint installation directory
67. IUNIT CURITE YPE END C DIPSTAT SUBROUTINE DIPSTAT ISTAT CURITEM ISTAT PRINT CURITE END C lt lt lt D Cleanscape Software 1 EMO INC gt gt gt FortranLint User s Manual Version 6 x 134 Appendix E Sample Output FORTRAN 77 STRUCTURE ITEM CHARACTER 10 NAME INTEGER TYPE REAL DIMENSIONS 3 ND STRUCTUR RECORD I E E NE Q a ul H E lt INTEGER INUSE 2 STATUS COUNT TIM COMMON BLOCK INUSE STATUS COMMON BK2 COUNT TIME Gl E 2 Analysis Output FortranLint Rev 5 0 2 Jan 02 10 49 55 Page 1 Default options w u 0207 276 76 261 Ttrim Xno unreferenced parameters Xno unused common variables Command options f g s t x Sdemo 7 demo f KKK KKK KKK KKK KK KKK KKK KKK KKK KK KKK KKK KKK KKK KH KK AH KK KH KK KH KK KH TH KH KK AH KK KH KK KH TH KH KH TH AH KK A KH AH AH A KH KU KU Program PROCDAT File demo f Line 2 gt 50 CALL GETUNIT I 5 IUNIT PUNIT gt N demo f PROCDAT line 6 INTERFACE WARNING 63 expression is changed by subprogram gt 50 CALL GETUNIT I 5 IUNIT PUNIT S A demo f PROCDAT line 6 INTERFACE ERROR 57 too many arguments gt CALL READNAME CURITEM NAME CURITEM DIMENSIONS gt N demo f PROCDAT line 7 INTERFACE ERROR 252 R 4 array passed to dummy arg which i
68. KKK KKK KK KKK KK KT KH KH KH KH KH RK KH TH KH KK KH KK KH TH KH KH KK KH KH KK A KH TH KH KK KH KK KH AH KK AH KH TH AH A KH KU KU Subroutine READNAME File DEMO F Line 19 DEMO F READNAME line 22 INTERFACE WARNING 185 common block BLOCK length mismatch compared to initial use in routine PROCDAT o EMO F READNAME line 22 NTERFACE WARNING 122 common block BLOCK organization differs at member INUSE H compared to initial use in routine PROCDAT KKK KKK KKK KKK KK KKK KKK KKK KKK KK KKK KKK TH KH KK KH TH KH KK AH KK KH TH KH KH KK KH TH AH KK AH KK KH KK KH KK KH TH KH KK AH KH KH AH A KH KU U Subroutine SETTYPE File DEMO F Line 27 IF CURITEM TYPE GT 5 CALL PRINT CURITEM A EMO F SETTYPE line 30 NTERFACE ERROR 56 not enough arguments HO VV KKK KKK KKK KKK KKK KKK KK KKK KKK KK KKK KKK KKK KKK KH KK KH KK KH TH KH KH KK KH TH KH KK AH KK HK KH KH KK KK AH KH FH KH KH TH AH A KH KU KU Subroutine PRINTIT File DEMO F Line 38 CALL DIPSTAT 4 CURITEM A EMO F PRINTIT line 42 NTERFACE ERROR 59 constant is changed by subprogram HUVV CALL DIPSTAT 4 CURITEM A EMO F PRINTIT line 42 NTERFACE ERROR 248 struct ITEM passed to a R 4 dummy arg HO VV T DEMO F PRINTIT line 43 USAGE WARNING
69. OC ARRAY DIM MASK MINLOC ARRAY DIM MASK ARRAY must be an integer or real array DIM is optional if present must be integer scalar MASK _ isoptional if present must be of local type and conformable with ARRAY To apply the ANSI X 3 198 1992 rules for MAXLOC and MINLOC use the option Mansi_maxloc or MISC ansi maxloc under VMS This option disallows the DIM argument Note that ansi maxloc does not apply to DEC targets i e Digital Fortran 90 Cleanscape Software FortranLint User s Manual Version 6 x 5 Controlling Analysis 43 5 VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV Controlling Analysis 5 1 Setting the Scope To enable global inter module checking use the g option or GLOBAL under VMS Global checking analyzes FORTRAN sources as a group this enables interface checking and improves usage checking of variables passed as actual arguments If g or GLOBAL is not specified subprograms are processed on an individual basis and call interface checking is not performed 5 2 Message Classification FortranLint checks for the following five general classes of problems e Syntax problems e Subprogram interface problems e Variable usage problems e Portability problems e Implicitly typed variables Syntax problems are constructs that will not compile or that may be interpreted by the compiler in a different way than the pro
70. OME to a full path for the X lint installation directory For example if the user is using csh use commands of the form setenv XLINTHOST nodename setenv XLINTPATH source_path setenv XLINTHOME installation_directory Cleanscape Software FortranLint User s Manual Version 6 x 148 7 Appendix H Xlint Installation If the user is using sh use commands of the form XLINTHOST nodename export XLINTHOST XLINTPATH source_path export XLINTPATH XLINTHOME lt installation directory export XLINTHOME Note There should no white space on either side of the equals sign For other shells substitute the appropriate commands Add XLINTHOME to the user s search path This step can be omitted if FLINTHOME points to the same directory as XLINTHOME and FLINTHOME has been already been added to the search path For csh users use the command set path path XLINTHOME For sh users use the command PATH XLINTHOME PATH To make the changes permanent add the new command to the appropriate login scripts For example for csh users modify cshre Optional The Xlint package includes a utility program flpatch that can be used to patch the Xlint installation directory and server name directly into the xlint executable To patch the executable use commands of the form flpatch xlint home directory flpatch xlint host hostname Replace directory with the Xlint installation directory and hostname with the host name for
71. P 49 XA DIMS R 8 3 local READNAME demo f 19 P 23 D 24 S I I 4 local PROCDAT demo f 5 RS 6 R INUIT I 4 local PRINTI demo f 43 SA INUSE Lee bytes 0 1 of PRINTI demo f demo inc 9 D demo inc 10 D 40 R common BLOCK ISTAT I 4 local DIPSTA demo f 48 P 49 S Cleanscape Software FortranLint User s Manual Version 6 x 142 Appendix E Sample Output FORTRAN 77 IUNIT I 4 local PROCDAT demo f 3 D 6 RA 9 RA 11 R PRINT demo f 33 P 35 RA PRINTI demo f 38 P 40 R 45 R NAME CHAR local READNAME demo f 19 P 20 D 24 S PUNIT I 4 local PROCDAT demo f 3 D STATUS I 4 bytes 2 5 of PRINTIT demo f demo inc 9 D demo inc 10 D 41 5 common BLOCK UNIT I 4 local GETUNI demo f 14 P 15 D 16 S UNIT1 I 4 local GETUNI demo f 14 P 15 D 16 R LEGEND A actual argument B used as an assumed array bound D declaration E eguivalenced F statement function dummy argument G used as a label in a goto statement I initialized i initialized indirectly L used as a label in an assign statement M allocated N nullified O optional dummy argument P dummy argument R referenced S set X usage cannot be determined Z deallocated Cleanscape Software FortranLint User s Manual Version 6 x Appendix F Diagnostic Messages 143 Appendix F VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV Diagnostic Messages F 1 Format FortranLint s diagn
72. R demo90 90 MAIN MAIN_INNI of demo90 f90 type MY MAIN YPE R type MY MAIN YPE R I 4 RO MAIN MAIN_INNER line 53 of demo90 90 INT I 4 intrinsic function Called by demo90 f90 KIND I 4 intrinsic function Called by demo90 f 90 MAIN MAIN INNER MAIN INNER I 4 MAIN internal defined at Args R 4 array R Called by demo90 90 MAIN PRESENT L 4 intrinsic function Called by demo90 f90 OUTER SIZE I 4 intrinsic function Modules Called by demo90 f 90 MAIN MAIN INNER OUTER demo90 90 MAIN M defined at line 3 of demo90 f90 Called by demo90 f90 Types MYTYPE size 26 bytes NAME CHAR 10 in demo90 90 M is Unused in demo90 90 M M_INNER is Ref Set in demo90 90 OUTER is Unused SCORES 2 2 I 4 KIND 4 in demo90 90 M is Unused in demo90 90 OUTER is Ref Set TYPE_S size 26 bytes NAME CHAR 10 in demo90 90 MAIN is Unused SCORES 2 2 I 4 KIND 4 in demo90 f f90 MAIN is Ref Actual arg Records STUDENT1 type TYPE S local in demo90 90 MAIN is Ref Set Actual STUDENT2 type TYPE_S local in demo90 f 90 MAIN is Ref Actual arg YPE1 type MYTYPE local in demo90 90 M M_INNER is Dummy arg in demo90 f90 0UTER is Dummy arg Set YPE2 type MYTYPE local in demo90 90 M M_INNER is Dummy arg in dem
73. R KIND intrinsic function e F08 extension to SELECTED REAL KIND intrinsic function Other A dditions Improvements e A new command line switch o message format use single quotes on nix to change the format of Flint s analysis messages suitable for interfacing to ID E editor e 14 new error messages for a total of 1017 unique Fortran checks e Minor bug fixes e Various operational enhancements User Interface C hangs to N ote e Separator for cross reference xref content selection is now instead of see Section 8 4 Prior versions of Flint retain the old syntax 1 3 Document Scope This is the command line reference manual that gives full descriptions of all commands available in FortranLint All users no matter what user interface mode they use should reference this document for full descriptions of each command Chapters 11 16 also describe the use of X lint an adjunct graphical source browser available on Unix and Linux only The FortranLint G UI an executable called flintgui available for Unix Linux Mac and Windows is a front end to the command line FortranLint product The command line option used to fulfill a GUI operation is detailed in the G UI s online help reference For installation and usage of the Flint GUI consult the flintgui pdf file located in the doc subdirectory 1 4 Documentation Style Command descriptions for Unix Linux Mac FreeBSD and Windows are all the same exc
74. SCORES 1 OPDUM N DEMO90 F90 OUTER line 32 SYNTAX ERROR 168 array referenced with too few subscripts KKK KKK KKK KKK KKK KKK KK KKK KKK KK KKK KKK KKK KKK KKK KK KKK KKK KKK KEK KKK KKK KKK KK KKK KKK KKK KKK Program MAIN File DEMO90 F90 Line 38 gt USE M TYPE_S gt MYTYPE amp MYLOC gt LOC Iprivate modul ntities cannot be accessed gt N Vv Cleanscape Software FortranLint User s Manual Version 6 x 126 Appendix D Sample Output Fortran 90 DEMO90 F90 MAIN line 42 SYNTAX ERROR 661 entity not accessible in module M CALL M INNER STUDENT1 STUDENT2 A gt gt DEMO90 F90 MAIN line 46 INTERFACE FYI 256 type TYPE_S passed to a type MYTYPE dummy arg same format but different names CALL M_INNER STUDENT1 STUDENT2 A gt gt DEMO90 F90 MAIN line 46 INTERFACE FYI 256 type TYPE S passed to a type MYTYPE dummy arg same format but different names CALL OUTER STUDENT1 STUDENT2 A gt gt DEMO90 F90 MAIN line 47 INTERFACE FYI 256 type TYPE S passed to a type MYTYPE dummy arg same format but different names CALL OUTER STUDENT1 STUDENT2 A gt gt DEMO90 F90 MAIN line 47 INTERFACE FYI 256 type TYPE_S passed to a type MYTYPE dummy arg same format but different names
75. USER S MANUAL Cleanscape FortranLint SOURCE CODE ANALYZER Version 6 x Cleanscape Software International 172 College Street STE A Spencer TN 38585 Tel 931 946 1015 Fax 931 933 7658 E mail support cleanscape net Cleanscape FortranLint USER S MANUAL A SOURCE LEVEL CODE ANALYZER For FORTRAN PROGRAMMING On Unix Linux Windows Mac FreeBSD and VMS Systems Version 6 x Note Licensed users may photocopy for distribution Direct comments conceming this manual to the address on the title page or support cleanscape net Copyright 1987 2013 CLEAN SCAPE NOTICE OF COPYRIGHTS Copyrighted by Cleanscape as an unpublished work All rights reserved In claiming any copyright protection which may be applicable Cleanscape reserves and does not waive any other rights that it may have by agreement statutory or common law or otherwise with respect to this material See Notice of Proprietary Rights NOTICE OF PROPRIETARY RIGHTS This manual and the material on which it is recorded are the property of Cleanscape Its use reproduction transfer and or disclosure to others in this or any other form is prohibited except as permitted by a written License Agreement with Cleanscape Cleanscape reserves the right to update this document without prior notification FortranLint is a registered trademark of Cleanscape Software International Xlint is a trademark of Cleanscape Software International All other product names m
76. VVVVVVVVV VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV Library Support 9 1 Overview FortranLint supports a feature similar to C prototypes Specifically the user can create library template files for use in subsequent analysis operations A library template or Ibt file isa binary file that describes the interface structure of a library or package Ibt files contain data structures similar to C prototypes but with additional information specifically reference set flags and argument level options FortranLint uses lbt files to check calls to external libraries or packages Ibt files allow FortranLint to perform interface checks whether or not library source code is available Reference set flags allow the user to describe individual routines more completely than traditional prototypes improving the accuracy of generated reports Argument level options allow the user to fine tune interface checking for individual routines The FortranLint package includes two pre defined Ibt files named unixlib lbt and vmslib lbt These Ibt files describe standard UNIX and VMS library routines respectively Note The FortranLint package also includes the source code for these two Ibt files see section 9 2 To create a library template file two steps are required a Write a text version of the file b Translate the text version to binary These steps are explained i
77. VVVVVVVVVVVVVVV VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV Xlint Introduction NOTE Xlint has been deprecated on most hosts and is not available under Windows A GUI interface is provided for most host platforms See the flintgui pdf manual in the doc subdirectory for more information Therefore Windows users can skip Chapters 11 16 Xlint is a Motif based programming tool It is designed to provide FORTRAN developers with an interactive graphical user interface that can be used to browse FORTRAN source files X lint operates on the database or fdb files generated by FortranLint With four windows displaying information X lint allows the developer to step through potential errors and to see the relationships between source code call tree and symbol table information all on one screen Symbol cross reference information can be automatically brought up showing all code references to any symbol in the analyzed program Each occurrence of a symbol can quickly be found in the source code at the same time the appropriate node is highlighted in the displayed call tree Cleanscape Software FortranLint User s Manual Version 6 x 12 Learning About Xlint 83 12 VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV Learning About Xlint This chapter will cover the basics that users need to know before running X lint and will help them understand the usage and function of
78. VVVVVVVVVVVVVVVVVVVVV VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV Database Files and Xlint 13 1 Overview As explained in chapter 10 database or fdb files are binary files that contain symbolic information for one or more FORTRAN source files X lint uses the information stored in fdb files to browse the associated source files and or analysis output Database files may be created from the command line using FortranLint or they may be generated inside X lint For the command line procedure see section 10 2 Section 13 3 covers the X lint procedure Note This chapter assumes that the environment variable or V MS logical XLINTPATH is set properly If X lint is being run from a directory other than the directory that contains project sources XLINTPATH should point to the directory that contains the sources 13 2 Loading Database Files Before X lint can be used a database fdb file must be loaded To load a database file inside X lint proceed as follows 1 Select the File menu from the options at the top of the screen 2 Select Load Database from the File menu This will bring up a directory and file selection screen 3 Select the appropriate directory To select the desired fdb file double click the file or click the file to highlight it and then click OK The lint summary for the specified fdb file should appear in the Lint window Alternatively a database file ma
79. ample Result Xno unused variables Suppress unused variables Xand par named 00 Also show parameters with names ending in oo Xonly ref dum var nam i Show referenced dummy variables named i XREF common arrays Show arrays in common blocks XREF arr named a b c Show arrays named any letter b zero or more letters ca 1 The conjunction if specified must be first This word specifies whether the criteria sentence is a selection filter or addition The default mode of operation is ONLY Cleanscape Software FortranLint User s Manual Version 6 x 8 Cross Reference 69 Word Type Description ONLY selection suppress everything but the following default NO filter suppress the following AND addition add the following to what is already selected will not be subject to previous filter criteria 2 The usage adjective if specified must be next This word acts on symbols at the subprogram program unit level If a symbol is used in a particular subprogram program unit in the fashion described by the usage adjective the use of that symbol within the sub program program unit is included in the selection If the usage adjective is omitted FortranLint disregards usage when determining the selection Word Antonym Description used unused Referenced set called or indeterminate referenced unreferenced set unset called uncalled indeterminate determinate actualarg notactualarg Variables passed to external routi
80. an optional dummy argument P Dummy arg Symbol appeared in a subroutine or function statement R Ref Symbol was referenced its value was used S Set Symbol was assigned a value x Indeterminate May be ref or set but exact usage cannot be determined Z Deallocated Symbol was deallocated Usage information Ref Set is carried through all variable associations including actual dummy argument common block member and eguivalence associations The default is to suppress unused common blocks For additional information see section 8 4 Cleanscape Software FortranLint User s Manual Version 6 x 66 8 Cross Reference 8 2 8 Parameters Parameters are shown along with their data type and their value Parameters from different routines that have the same name and the same value will be merged The following usage codes apply to parameters Line Subprogram codes codes Description D Symbol appeared in a declaration type decl parameter R Ref Symbol was referenced its value was used S Set Symbol was assigned a value parameter statement The default is to suppress unreferenced parameters For additional information see section 8 4 8 2 9 Eguivalences Entries for variables include eguivalence information For non common block mem bers eguivalences are named variables in the same scoping unit or the parent scoping unit For common block members eguivalences belong to the same common block Note When a variable is eguivalen
81. b s c i real a b c end This stub asserts that modtab references its first argument and sets its second argument The status of the third argument is indeterminate To combine two or more argument switches use a single slash followed by the appropriate letters For example x or asserts that the argument x is optional and that it is referenced Note The s r and or I switches cannot be combined for a given argument 9 3 Creating Library Template Files To create an Ibt file for a specific library or package write an appropriate Ish file as explained in section 9 2 then execute acommand similar to the following flint L mylib lbt mylib lsh or flint LIBRARY mylib lbt mylib lsh under VMS Substitute the appropriate name for mylib This command will add entries from the library shell file mylib Ish to the library template file mylib Ibt If mylib Ibt doesn t exist it will be created O therwise the existing file will be updated Note FortranLint can generate lbt files directly from library sources i e commands of the following form will work flint L mylib lbt for Or flint LIBRARY mylib lbt for under VMS Cleanscape Software FortranLint User s Manual Version 6 x 9 Library Support 77 However the L and LIBRARY options cause FortranLint to run in a special mode which bypasses normal analysis Consequently input files must be debugge
82. bols unnamed block data subprograms program units are named Blockdata Blockdata2 etc The filename and the line number where the block data subprogram program unit begins are shown along with the block data name 8 2 3 Subroutines and Functions External procedures internal procedures F90 only module procedures F90 only intrinsic procedures and statement functions are shown in this section and are labeled correspondingly For functions the data type isshown This is normally the data type of the function definition If the function is undefined the data type used by the first function call is used An internal subprogram F90 only has its parent routine as a qualifier using a double colon for example SUB SUB_INNER If the code for the subroutine or function appeared in the sources analyzed the filename and line number of the subroutine function statement are shown If the definition was in a FortranLint library lbt file the name of the library is shown Argument descriptions of external internal and statement functions are also shown if the g or GLOBAL option was used during analysis The argument descriptions show the class data type and usage of each argument Argument class is one of the following lt blank gt variable array variable or record array subprogram function or subroutine return alternate return unused argument Argument usage is indicated by the single letter c
83. ced to an array element FortranLint recognizes only the array name as eguivalence Conseguently when two variables that are not common block members are eguivalenced to different elements of the same array FortranLint will show the two variables and the array as the eguivalence of one another In case of two different scalar members of the same common block that are eguivalenced to different array elements of the same array FortranLint will show the array as the eguivalence of both scalar members 8 2 10 High Performance Fortran HPF If HPF checking is enabled and if the linenumbers or tabular format is selected the cross reference includes a section that displays occurrences of HPF processors and templates For additional information on HPF see section 4 9 For additional information on the linenumbers and tabular formats see section 8 3 Cleanscape Software FortranLint Users Manual Version 6 x 8 Cross Reference 67 8 3 Format Selection FortranLint allows users to select different formats for the cross reference table by using the X option UNIX or XREF VMS Available formats include Xfreeform XREF freeform X no tabular XREF no tabular X no equiv XREF no equiv X no linenumbers XREF no linenumbers X no legend XREF no legend freeform tabular Xtabular or XREF tabular V MS selects a table style that uses fixed width columns The output is 132 or more columns wide The default line numbering
84. ciated source code is modified 10 4 Using FDB files as libraries For FLINT rev 4 33B or later fdb files can be used as libraries In other words you can specify fdb files instead of Ibt files on the command line There is one special case If the file list starts with an fdb file FLINT runs in database mode and all other file arguments are ignored For more information about database mode see section 10 3 Two option switches may be used to control the way fdb libraries are used 1 Mlibcom By default FLINT doesn t check source level common blocks against common blocks declared inside fdb libraries If Mlibcom is used FLINT checks source level commons against all fdb files specified on the command line Mlibcom also suppresses not referenced not set messages for commons in the user s code which are referenced or set at the fdb level 2 Mlibext By default FLINT searches all specified fdb files for missing procedures If Mlibext is used searching is suppressed unresolved procedures are treated as external whether or not they are defined inside fdb files Restriction FLINT does not yet support translation of library shell Ish files to fdb format For information on Ish files see chapter 9 Cleanscape Software FortranLint User s Manual Version 6 x 11 Xlint Introduction 81 11 VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
85. d and free of errors before lbt files are created If library code is modified repeat the original L or LIBRARY operation to update the Ibt file Note that FortranLint will not update Ibt files automatically Example To rebuild unixlib lbt go to the appropriate directory and execute flint L unixlib lbt unixlib lsh To rebuild vmslib Ibt under VMS go to the appropriate directory and execute flint LIBRARY vmslib lbt vmslib Ish 9 4 Library Precedence When analyzing calls to functions or subroutines FortranLint uses the following definitions highest precedence first a Definitions found in the user s Fortran source files b Definitions found in the intrinsic table associated with the selected target compiler c Definitions found in user specified Ibt files d Definitions found in unixlib lbt or vmslib Ibt under VMS By default the intrinsic table takes precedence over user specified lbt files To search user specified Ibt files before the intrinsic table specify the option Muselbt or MISC uselbt under VMS If this option is used b and c are reversed in the preceding list Note The default system library templates unixlib Ibt and vmslib lbt have the lowest precedence whether or not the uselbt option is specified 9 5 Miscellaneous Library Issues 9 5 1 Interaction with Cross Reference and Call Trees Cross reference tables and call trees automatically
86. d to delimit array constructors in addition to previous standard e Binary Octal and Hex BO Z constants to intrinsic functions INT REAL DBLE and CMPLX Intrinsics ISO_C_ BINDING ISO FORTRAN ENV IEEE ARITHMETIC IEEE EXCEPTIONS IEEE FEATURES BIND statement and attribute Language binding can be specified in FUNCTION SUBROUTINE and ENTRY statements e INTRINSIC and NON INTRINSIC can be specified for modules in USE statements e GET COMMAND GET COMMAND ARGUMENT COMMAND ARGUMENT COUNT and e GET ENVIRONMENT VARIABLE intrinsics e F08 COMPILER OPTIONS and COMPILER VERSION intrinsic functions e KIND argument may be supplied to ACHAR IACHAR ICHAR LEN and LEN TRIM 10 e FLUSH statement e WAIT statement with ASY NCHRONOUS ASYNCH and DONE extensions from IBM e ASYNCHRONOUS statement and attribute e The following I O specifiers have been added or updated to the F03 standard ACCESS ASYNCHRONOUS along with ASY NCH alias an IBM extension BLANK DECIMAL DELIM ENCODING ID IOMSG PAD PENDING POS RECORDTYPE DEC HP Intel extension ROUND SIGN SIZE and STREAM e F081 O specifier NEWUNIT e Any KIND is permissible with integer specifiers SIZE NEXTREC etc Cleanscape Software FortranLint User s Manual Version 6 x 1 Introduction 7 Intrinsic functions IS IOSTAT END IS IOSTAT EOR Comma after a P edit descriptor is optional when followed by a repeat NEW LINE intrinsic function SELECTED CHA
87. dditional information Specifically dummy argument usage is shown for subroutine and function definitions In addition the usage of the variables and arrays that are passed as actual arguments are determined 8 2 Layout Symbols are grouped into the following categories Programs Block data subprograms program units Subroutines Functions Modules F90 only Common blocks Structures Records Variables and arrays Parameters Symbols are sorted alphabetically by name within each group If a symbol appears in more than one context e g as a variable in one subprogram program unit and as a subroutine name in another the symbol is shown in both groups In the tabular format cross reference the program block data module F90 only subroutine and function sections are combined as are the records and variable array sections The information shown for each symbol will vary by category 8 2 1 Program Routines This symbol name is derived from the program name given on a program statement If an unnamed program routine exists it is given the name Program Multiple unnamed programs are named Program2 Program3 etc The filename and the line number where the program routine begins are shown along with the program name Cleanscape Software FortranLint Users Manual Version 6 x 8 Cross Reference 63 8 2 2 Block Data Routines These are the symbol names from block data statements Like program sym
88. ded by INCLUDE statements are loaded directly by FortranLint i e these files are not preprocessed 4 4 CDD and DBMS Processing VMS Only 4 4 1 CDD Common Data Dictionary Declarations FortranLint supports standard DICTIONARY statements DICTIONARY is similar to INCLUDE in that it adds declarations to the current routine However DICTIONARY differs from INCLUDE in that it takes data structures from a CDD dictionary instead of a source file FortranLint uses the FORTRAN compiler as a preprocessor to expand DICTIONARY statements into normal code 4 4 2 DBMS Support FDML Statements FortranLint supports FD ML statements for example invoke ready use commit rollback disconnect connect erase get modify fetch find free also null within keep reconned and store invoke statements are preprocessed by the FORTRAN compiler in the same manner as DICTIONARY statements FortranLint processes all other FD ML statements directly Note Usage checking is suppressed for variables that are created by invoke statements 4 4 3 CDD DBMS Requirements FortranLint uses the FORTRAN compiler to expand DICTIONARY and invoke statements into normal code The FORTRAN compiler must therefore be installed before these statements can be processed Additionally the VMS CD D package must be installed before DICTIONARY statements can be processed and the VMS D BMS package must be installed before invoke statements can be processed Cleanscap
89. e 3 UNIX style option help SPLIT split output to files DATA f create database FDB SUMMARY summary mode implies SPLIT XREF c cross reference XREF help for more info TREE c call tree TREE help for more info 5 FortranLint is now ready for use Note At this point Xlint may be installed For additional information see Appendix I B 4 Patching FortranLint Some of the default parameters in FortranLint can be modified within the FortranLint executable This is accomplished using the FLPATCH program This program takes three command line arguments 1st name of the executable required 2nd parameter to patch 3rd desired value If the second or third arguments are not given the user will be prompted for them The patchable parameters in FortranLint are Name Description Default value home installation directory ai host license server host NO DECNET To patch FortranLint use a command of the following form FLPATCH flint exe home disk2 appl FLINT Cleanscape Software FortranLint User s Manual Version 6 x Appendix B Installation Under VMS 117 a The home parameter sets the default for the application support directory home can be overridden by the system logical FLINTHOME The default value for the home parameter indicates that the installation directory is not specified Unless the FLINTHOME logical is specified an error message will be issued reporting that the
90. e Software FortranLint User s Manual Version 6 x 40 4 Command Reference 4 5 FORTRAN 77 Extensions FortranLint s FORTRAN 77 support is based on the 1978 ANSI FORTRAN 77 standard FortranLint also supports extensions implemented by the following compilers System Compiler Dialect code ANSI standard FORTRAN ANSI X3 9 1978 ANSI77 Cray YMP UNICOS CFT77 5 0 CRAY Alpha Digital UNIX OSF1 DEC FORTRAN 6 0 DECUNIX VAXNMS DEC FORTRAN Version 6 0 DECVMS HP9000 Series HPUX FORTRAN 9000 8 05 HPUX Windows and Linux systems Lahey Fortran F77 LAHEY NCUBE NCUBE Fortran NCUBE OS32 Concurrent Fortran OS32 Silicon Graphics IRIX 4D 3 3 FORTRAN 77 SGI SunOS Solaris Sun FORTRAN 1 4 SUN VAX Ultrix VAX FORTRAN VAXULTRIX Extensions supported by FortranLint include but are not limited to the following Cleanscape Software D ata type size specifiers for example INTEGER 4 Records structures and unions Cray style and Apollo style pointers Debugging lines with D or Y in the first column TAB formatting In line comments both and styles Long symbol names with non alphanumeric characters Numerous binary octal and hex constant formats Hollerith constants Namelist I O Dozens of system specific I O statement specifiers Hundreds of intrinsic functions All I O format strings including embedded expressions Abbreviated and symbolic expression operators Recursion Array sections and array expressions Fo
91. e directly into the FLINT EXE executable To patch the executable use commands of the form FLPATCH FLINT EXE HOME disk directory path FLPATCH FLINT EXE HOST node name disk diretory path should specify the FortranLint installation directory node name should be the appropriate node name or NO DECNET as explained in step 5 For additional information on FLPATCH see section B 4 7 Users are now ready to activate FortranLint B 3 Activation Procedure Each FortranLint license must be assigned a unique authorization number or activation key by Cleanscape before the package will run 1 To proceed execute the following command flint license activate The software will provide users with a server code and it will prompt them to call Cleanscape for activation If users have not already received an activation key they will need to contact Cleanscape Cleanscape will provide an activation key based on the server code 2 After the activation code is obtained execute the command flint license activate again and enter the activation code when prompted Note A file called 02 lic or 07 lic will be created in the FortranLint installation directory This file stores information related to the activation key 3 The activation procedure in step 2 also creates a script file called START UP COM in the installation directory This file will allow users to load the daemon from the command file To start the license dae
92. e files use the B option or DATABASE under VMS as follows flint Babfile foo1 f foo2 f foo3 f or flint DATABASE dbfile fo01 for foo2 for foo3 for under VMS dbfile specifies the base name that should be used for the database The filename extension fdb will be added automatically If the specified database file already exists it will be overwritten To suppress console error messages during database creation add the option switch Oall or SUPPRESS ALL under VMS to the FortranLint command line Cleanscape Software FortranLint User s Manual Version 6 x 80 10 Database Files 10 3 Using Database Files To extract information from an existing database file use a normal flint command with the database file as an argument For example flint t dbfile fdb or flint TREE dbfile fdb under VMS The command line should not specify any other database files or FORTRAN source files All call tree options are available when database files are processed Most of the cross reference options are available line is an exception Xline and XREF line are ignored flint uses the line value set when the database file was generated Additionally if unreferenced parameters or unused common block members are not selected when the database file is created the associated messages will not be provided by subsequent database queries fdb files should be regenerated whenever the asso
93. e for demo for DEMO90 FDB database file for demo90 f90 XLINT DAT Xlint resource file XLINT EXE Xlint executable file 5 Modify the user configuration for each FortranLint user as follows a If the FortranLint license manager is installed on a DECNET server set the logical FLINTHO ST to the node name for the server Otherwise set FLINTHOST to NO_DECNET Note To obtain the node name execute the command show logical SYS N ODE on the server Discard any colon characters define FLINTHOST node_name Set the logical FLINTHOME to a full path for the FortranLint installation directory define FLINTHOME disk installation directory Define the symbol FLINT as a foreign command to execute FLINT EXE located in the installation directory FLINT FLINTHOME FLINT EXE Define the symbol FLPATCH as a foreign command to execute FLPATCH EXE located in the installation directory FLPATCH FLINTHOME FLPATCH EXE To make the changes permanent add the new commands to the appropriate LOGIN COM files Example Cleanscape Software DEFINE FLINTHOST GUMBY DEFINE FLINTHOME disk3 USR PETER FLINT FLINT FLINTHOME FLINT EXE FLPATCH FLINTHOME FLPATCH EXE FortranLint User s Manual Version 6 x Appendix B Installation Under VMS 115 6 Optional The FortranLint package includes a utility program named FLPATCH EXE that can be used to patch the host directory path and server node nam
94. e this option use T notrim or TREE notrim trim is strongly recommended for systems that are low on disk space For additional information on call trees see chapter 7 T option Note To set call tree options without generating a call tree use T option followed by t TREE option Note To set call tree options without generating a call tree use TREE option followed by t Enables variable usage checking For example this feature detects variables that are referenced but not set The configuration file shipped with FortranLint enables this option by default If usage checking is not required for a given project u or NOUSAGE may be used to disable this option Some operations will be slightly faster if usage checking is disabled u USAGE FortranLint User s Manual Version 6 x 26 UNIXHELP 3 Command Reference See at the end of this list V SYSTEM D escription Syntax VMS syntax w WARNINGS D ssaiption Syntax V MS syntax Cleanscape Software FortranLint normally assumes that the FORTRAN compiler running on the host system will be used To select a different environment use this option In other words Assume my code was written for the following host even though I m running Flint on a different host V or SYSTEM tells FortranLint to assume that a specific compiler or FORTRAN dialect
95. ed users will need to execute the command startup from the installation directory Note that a single iptlmd process will allow both FortranLint and X lint to run Users will need to run startup every time they reboot the system or kill the license manager To avoid this step add the startup command to the appropriate system boot script 4 The license manager daemon reguires a three minute period after being started for initialization When the three minutes are up execute the command xlint Xlint is now ready for use Note For license manager options see Appendix C Cleanscape Software FortranLint User s Manual Version 6 x Appendix I Xlint Installation Under VMS 151 Appendix I VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV Xlint Installation Under VMS I 1 Pre installation The X lint installation procedure assumes that FortranLint has already been installed and activated If FortranLint has not been installed see the instructions in Appendix B Note The FortranLint Xlint installation directory mentioned in the following sections is the directory that contains the FortranLint Xlint support files for example flint err and flint cfg I 2 Installation Procedure 1 Log in as system manager 2 Go to the FortranLint Xlint installation directory The following Xlint support files should already be present XLINT EXE X lint executable file XL
96. ended character set is available use c4 b3 c2 c3 c0 Below is a squished tree produced by flint Tnotrim squish graphics c4 b3 c2 c3 c0 PROCDAT GETUNIT GETUNIT PRINT PRINTIT DIPSTAT PRINT GETUNIT READNAME SETTYPE PRINT PRINTIT DIPSTAT PRINT Cleanscape Software FortranLint Users Manual Version 6 x 8 Cross Reference 59 The default values are 2d 7c 2b 2b 2b see Section 7 2 1 To restore the default values use Tnographics UNIX or TREE NOGRAPHICS VMS 7 4 Call Tree Content 7 4 1 Top Node Call trees can be generated with any routine as the top routine When the top routine is selected the full tree and detached trees are suppressed To generate a tree starting at the routine name use the option switch Thead name or TREE HEAD name under VMS To display multiple trees specify multiple routine names For example Thead PRINT head SETTY PE or TREE HEAD PRINT HEAD SETTYPE under VMS will show trees for both PRINT and SETTY PE This is a primary tree starting at the program PRINT PRINT PRINTIT DIPSTAT PRINT GETUNIT This is a primary tree starting at the program SETTYPE SETTYPE PRINT PRINTIT DIPSTAT PRINT GETUNIT To cancel a previously specified Thead or TREE HEAD switch add Tnohead or TREE NOHEAD under VMS to the command line This will restore the full call tree 7 4 2 Undefined Routi
97. entioned in this document are registered trademarks or trademarks of their respective holders Table of Contents VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV Table of Contents Table of Contents I 1 Introduction 5 1 1 Overview 5 1 2 What s New in Version 6 6 1 3 Document Scope 7 1 4 Documentation Style 7 2 Getting Started 9 2 1 Installation 9 2 2 Analyzing Programs 9 2 3 Managing the Output 10 2 3 1 Severity Levels 10 2 3 2 Redirection 10 2 3 3 Statistics Output 10 2 3 4 Summary Mode 11 2 4 Call Trees and Cross Reference Tables 11 3 Command Reference 13 3 1 Command Line Options 13 3 1 1 Command Format 13 3 1 2 Option Format 13 3 1 3 List of Options __ 15 3 1 4 Using UNIX Switches Under VMS 30 3 2 Summary of Options 31 3 2 1 UNIX Option Summary 31 3 2 2 VMS Option Summary 32 3 3 Configuration Fles__ 34 3 4 Environment Variables Logicals 36 4 FortranLint Source Conventions 37 4 1 Source Format 37 4 1 1 Debug Lines 38 4 2 Include Files 38 4 3 C preprocessor UNIX Windows only 38 4 4 CDD and DBMS Processing VMS Only 39 4 4 1 CDD Common Data Dictionary Declarations 39 4 4 2 DBMS Support FDML Statements 39 4 4 3 CDD DBMS Requirements 39 4 5 FORTRAN 77 Extensions 40 4 6 Fortran 90 95 Extensions 41 4 7 Specifying FORTRAN Dialect 41 4 8 Default Sizes 41 4 9 High Performance Fortran HPF 42 5 Controlling Analysis 43
98. ept where noted and may be prefaced with the shorthand description UNIX Command descriptions for VMS are explicitly referenced with the text under VMS Flint with capital F may sometimes be used as a shorthand reference to FortranLint flint in all small letters is the instruction to use at the command line Commands are in Arial or Helvetica typeface FortranLint output isin Courier New typeface Cleanscape Software FortranLint User s Manual Version 6 x 8 2 Getting Started Cleanscape Software FortranLint User s Manual Version 6 x 2 Getting Started 9 2 VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV Getting Started 2 1 Installation For installation instructions see Appendix A Appendix B VMS only or for the FortranLint GUI see the separate FortranLint Quick Start Guide flintgui pdf in the doc subdirectory 2 2 Analyzing Programs To run FortranLint use a command of the form flint options file1 f file2 f file3 f or flint options file1 for file2 for file3 for under VMS where options may be one or more options and each of the specified files is a FORTRAN source file containing any number of FORTRAN program units Options may be intermixed with or appear after file names If FortranLint is invoked without any options or parameters a help screen will be displayed flint If source files are specified but no options are give
99. es as arguments Target systems are discussed in section 4 5 FO RTRAN 77 extensions and section 4 6 Fortran 90 extensions System names include ANSI ANSI90 CRAY DECUNIX DECVMS EPC HPUX NCUBE 0832 SGI SUN and VAXULTRIX Multiple targets may be specified To flag non A NSI constructs use a or ANSI under VMS If FortranLint is run in Fortran 90 95 mode these options have the same effect as Pansi90 and PORT ANSI90 Otherwise they have the same effect as Pansi and PORT ANSI Example If FORTRAN code is being ported to both VAX VMS and CRAY systems use Pdecvms Pcray or PORT DECVMS CRAY under VMS to check for portability problems related to either target system Note that Flint only performs ANSI checks against the F77 or F90 standards this is due to creeping featurism in compilers that allow F03 constructs into versions supporting F95 or even F90 5 6 Local Data Flow Analysis The ability to track local variables in Fortran code and intelligently report any anomalies in their usage is done with local data flow analysis Local data flow analysis is superior to sequential inspection of the source code for identifying problems with e initialization improper sequencing of set reference instances identifying dead or wasteful code If Fon under UNIX or FLOW on under VMS is added to the command line the source code will be analyzed to glean more informat
100. f the screen Select Load Database to bring up the Load Database dialog box Use the Directories and Filter options to go to the FortranLint X lint installation directory Double click demo fdb to select it or single click to highlight demo fdb and press OK Xlint should display analysis output for demo for in the Lint window 3 To display all the occurrences of a particular lint message double click the message with the left mouse button For example double click the following message IMPLCT 125 7x symbols were implicitly typed as to display all occurrences of IMPLCT 125 Note that 7x means that there are 7 instances of this message 4 After all instances are displayed double clicking one of the instances will display information related to the instance For example double click the following instance demo f 33 PRINT 125 symbols were implicitly typed as I 4 IUNIT The Source window should display source code with the highlight on IUNIT in line 33 The Tree window should display a call tree centered around the PRINT routine In the Cross Reference window the following line should be highlighted IUNIT I 4 variable in demo f 33 PRINT is Dummy arg Cleanscape Software FortranLint User s Manual Version 6 x 96 14 Xlint Getting Started 5 Double click a lint instance that is not currently highlighted For example demo f 49 DIPSTAT 125 symbols were implicitly typed as
101. foo for under VMS bar txt may specify any number of switches or filenames There are two restrictions a Arguments must be separated by white space or new lines b wildcards such as for are not supported Files used this way are called configuration files FortranLint may be used for multiple purposes quick syntax checks mapping out unfamiliar programs etc Configuration files are a convenient way to select different sets of options To set FortranLint options automatically create a configuration file named flint cfg and add option switches to this file FortranLint searches for flint cfg in the following directories a Current working directory b Directories specified by the environment variable FLINT CFG or logical FLINTCFG under VMS c FortranLint installation directory as specified by the environment variable FLINTHOME or logical FLINTHOME under VMS Note Command line option switches may be used to override options set by flint cfg Multiple configuration files may be used e g for different projects FLINTCFG should be set appropriately for users working on each project For additional information on FLINTCFG and FLINTHOME see section 3 4 FortranLint does not impose a fixed limit on configuration file line length However system constraints may impose a limit for some environments Cleanscape Software FortranLint User s Manual Version 6 x 3 Command Reference 35 This is the default flint cfg file
102. for version 6 Default Flint configuration file Included by default in every Flint run Note carefully the suppressed messages 0276 suppresses numeric conversion I like integer gt real integer gt char is detected as error 161 W enable warnings u enable usage checking 0207 I suppress hollerith constant warning 0276 I suppress data type conversion FYI 076 I suppress mixed mode arithmetic FYI 0261 I suppress initializer data type converted FYI Ttrim make TRIM the default tree format t default is to NOT output tree Xno unreferenced parameters Eliminate unreferenced parameters Xno unused common variables Show common variables only where they are used Xno named IEEE_ Exclude symbols for IEEE intrinsic modules Xno named C_ Exclude symbols for ISO intrinsic modules Xno named ISO_ Ditto Xno named COMPILER_ Exclude F08 COMPILER_VERSION COMPILER_OPTIONS X default is to NOT output xref Note VMS configuration files may use letter switches without special rules or restrictions However several restrictions apply if letter switches are used on the VMS command line For additional information see section 3 1 2 For the current set of default options see the copy of flint cfg provided with Flint Usage Hint If you are expecting but not seeing certain messages from Flint check the flint cfg file in use One classic example is the automatic conversion of integer to real as Mr
103. gend Selects legend for line resolution codes The VMS cross reference format content sub options are XREF freeform Free form cross reference XREF no tabular Tabular format vs freeform XREF no equiv Selects equivalence usage information XREF no line Line resolution vs subprogram resolution XREF no legend Selects legend for line resolution codes Two cross reference formats are supported freeform and tabular freeform is the default format This format uses variable length lines and shows information using a compact layout The default sub options for this format are Xnoline and Xnolegend or XREF noline and XREF nolegend under VMS The tabular cross reference format organizes fields into columns This format is at least 132 characters wide The default sub options for tabular cross references are Xline and Xlegend or XREF line and XREF legend under VMS Cleanscape Software FortranLint User s Manual Version 6 x 62 8 Cross Reference The line or noline sub option sets the cross reference to either line resolution or subprogram program unit resolution respectively Subprogram program unit resolution shows usage of a symbol within a subprogram program unit while line resolution shows usage of a symbol on each line in which that symbol appears This must be set during source analysis to have effect If the g or GLOBAL option is used the cross reference will include a
104. grammer intended This includes symbol names that have embedded blanks re declared or re dimensioned variables and poorly structured branches using GOTOs Interface problems are problems with the interaction between subprograms This includes inconsistent argument lists in function or subroutine calls inconsistent common block organization and unused or missing subroutines and functions Usage problems cover improper use of variables and arrays Variables should be both set and referenced any deviation from this is flagged Attempted redefinition of constants in subprogram calls is also flagged Portability problems are constructs that are allowed on the host system but are not recognized or are interpreted differently on other systems This includes structures pointers data type length specifiers and other extensions Cleanscape Software FortranLint User s Manual Version 6 x 44 5 Controlling Analysis Implicitly typed variables can be flagged whether or not the IMPLICIT NONE statement is used If IMPLICIT NONE is used they will be categorized as syntax errors FortranLint breaks syntax problems interface problems data usage problems and portability problems down into three levels of severity e Error messages are the most serious and indicate that the code will not compile or probably will not operate correctly e Warming messages flag constructs that may not operate as intended that may cause intermi
105. hapter 3 The maximum number of continuation lines supported is 1 000 lines per statement and there is a maximum of 32 000 significant characters per statement Cleanscape Software FortranLint User s Manual Version 6 x 38 4 Command Reference 4 1 1 Debug Lines Source lines starting with D in column one or Y for EPC code are debug lines By default debug lines are treated as comment lines If d or DLINES is specified FortranLint will process debug lines along with normal source code 4 2 Include Files Standard INCLUDE statements are supported FortranLint searches the following directories for INCLUDE files a The directory which contains the source file that the current INCLUDE statement belongs to b The user s current directory at the time when FortranLint was started c VMS only The absolute path specified by the INCLUDE statement taking logicals into account d Directories specified by I or INCLUDE option switches moving from left to right e UNIX only The standard directory usr include If an INCLUDE file can t be located FortranLint prints an error message and attempts to continue INCLUDE files may be nested up to 10 levels deep Note FORTRAN programs may use both INCLUDE statements and include statements include is similar to INCLUDE however include statements are handled by the C preprocessor F
106. he Cross Reference window shows all the cross reference information about SETTY PE Users can change the setting for any window at any time For example the depth of the parent or child tree in the Tree window can be changed by using the T ree O ption in the Control Panel The tree will be redisplayed with the new depth Cleanscape Software FortranLint User s Manual Version 6 x 100 15 More About Xlint READ 5 NAME DIMS END C SETTYPE SUBROUTINE SETTYPE CURITEM INCLUDE demo inc CURITEM TYPE gt CURITEM DIMENSIONS 2 IF CURITEM TYPE GT 5 CALL PRINT CURITEM END SUBROUTINE BEN CURITEM IUNIT subols vere implicitly tupsd as s data type conversion 8 Ix branch into do loop via label 1x not ensuch argumentas Ir expression is changed by subprograma Aus this name is defined as 4 subroutine ix common block 8 organization differs at member compared to Initial use in routine 8 Fig 15 1 Xlint Window for Sample Session 3 Cleanscape Software FortranLint User s Manual Version 6 x 16 Xlint Resource Files 101 16 VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV Xlint Resource Files 16 1 Overview A resource file is an ASCII text file that contains the configuration information needed for X lint to run X lint resource files conform to the standard X Window resource file conventions The default resource fi
107. hould be used locally instead of the logicals add them using 1 libcom Check source level common blocks against common blocks declared inside FD B libraries see section 10 4 FortranLint User s Manual Version 6 x 20 Syntax VMS syntax NOI4 See Ko Ae 0 D escription Cleanscape Software 3 Command Reference libcext Do not search FDB files for unresolved procedures treat such procedures as externals instead See section 10 4 noexit For UNIX users who use shell scripts to check FortranLint results This sub option tells FortranLint to retum zero unless errors were detected omp Perform a heuristic analysis of common O penMP problems It is especially suited for customers moving from sequential to parallel code This feature is licensed separately contact Cleanscape for additional information path ignore Ignores directory paths inside INCLUDE statements Useful when Fortran files are moved from one machine to another Use I to specify what directories should be used uselbt Modifies the precedence rules used for library template Ibt files For additional information see section 9 3 M option MISC option Reformat Flint s output with flexibility as to placement of the sections Valid entries and their meanings are Space F Filename fully qualified L line number C Column number S Severity error warning info T Type syntax interface usage portability I
108. ild Menu The Build menu is used to create or update a database fdb file The status field on the control bar shows the status of the most recent rebuild Configure Used to select the name of the database the source files and options used during source processing Rebuild Runs FortranLint with the configured options and files to regenerate the database file Kill Rebuild Process Stops the source processing available only during rebuild Use Rebuilt Database Loads the database that was last rebuilt by the Rebuild menu selection This has the same effect as loading the database from within the File menu View Build Output Pops up a window that shows the output from Fortran Lint during the rebuild process The FortranLint output can be used to determine why a build operation failed 12 5 Source Window The source code currently being analyzed is displayed in this window Action in other windows will cause files to load automatically and jump to the appropriate point in the source A lookup can be performed on highlighted items that can affect the Tree and Cross Reference windows The popup menu can be used to select the source related to what is currently highlighted in the other windows With these options users can step through the cross reference entries one by one or repeat a text search with a click of the mouse Previous Xref Goes to the text referred by the cross reference entry one before the current highlight in the
109. include referenced library routines Cross reference tables print library names along with routine names Call trees use curly braces to flag library routines 9 5 2 File Format Jbt files are revision locked If incompatible Ibt files are used FortranLint will print a warning message Cleanscape Software FortranLint User s Manual Version 6 x 78 9 Library Support Cleanscape Software FortranLint User s Manual Version 6 x 10 Database Files 79 10 VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV Database Files 10 1 Overview FortranLint can be used to create database or fdb files for use in subsequent analysis operations A database or fdb file is a binary file that contains symbolic information obtained from one or more FORTRAN source files Files with the extension fdb are database files generated by FortranLint during source code analysis fdb database files contain symbolic information for the modules processed fdb files may be used to re generate cross reference tables call trees diagnostic messages etc without re analysis of the original source code As of rev 4 33B fdb files may also be used as libraries In other words fdb files can be used instead of Ibt files on the command line For additional information see section 10 4 10 2 Creating Database Files To create databas
110. ion by analyzing down each of the program s control paths For example with this option on Fortran lint will inspect both branches of an IF THEN ELSE conditional to determine if a variable has been initialized for both branches and whether a variable has been set before referenced in either branch Using this option will add processing time to the analysis The amount of extra time is determined by the complexity of the source i e nested loops IF blocks or excessive use of GOTOS Additional capability is added from time to time for a complete list of dataflow analysis options try the Fhelp option on the command line Cleanscape Software FortranLint User s Manual Version 6 x 6 Analysis Output 47 6 VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV Analysis Output 6 1 Overview By default FortranLint sends all text output to the console stdout or SYS OUTPUT under VMS The output is divided into sections which are printed in the following order Section Controlled by Current options N A List of source files N A Source listing i LISTING INCLUDE Analysis output g u m P a w f O GLOBAL USAGE IMPLICIT PORT ANSI WARNINGS FYI SUPPRESS Call tree T TREE TREE Cross reference tables X X XREF XREF Statistics S STATISTICS To redirect output use the standard UNIX redirection operators or FortranLint s S and
111. is recommended in this mode no condensed Condenses multiple calls to the same routine If aroutine calls the same routine many times these calls are merged into one call For older versions of FortranLint this is the default mode disable Disables call tree output This sub option has the same effect as t or NOTREE under VMS enable Enables call tree output This sub option has the same effect as t or TREE under VMS graphics xx xx Changes the tree graphics characters The values given are the hex codes for the following shapes 1 2 3 4 5 The values are two digit hex codes separated by colons For example if the IBM extended character set is available the following values may be used graphics C4 B3 C2 C3 C0 nographics Restores the default graphics characters head symbol Suppresses the full call tree and shows a call tree with the specified symbol as thetop node Multiple top nodes may be specified help Outputs a help screen describing tree sub options and terminates FortranLint no library Shows calls made to routines defined in library template Ibt files For additional information see chapter 9 no squish Compresses call trees vertically by removing excess line graphics The resulting trees are less readable but require only half the space Cleanscape Software FortranLint User s Manual Version 6 x 8 Cross Reference 55 no tim Tri
112. l names differ Member types and sizes match the model but they have different names layout differs Member types and or sizes don t match the model 8 2 6 Structures and Structure Components The cross reference lists all structures used by the program including their size format and members Structures of the same name size and format are merged If the linenumbers or tabular format is selected the cross reference also includes a section labeled Structure components which lists occurrences of structure components For additional information on the linenumbers and tabular formats see section 8 3 8 2 7 Variables Arrays and Records Variables arrays and records are shown in this section This includes automatic local dummy common block members and F90 module entities Arrays are distinguished by the dimension list Each dimension is shown as either an upper bound or a lower upper bound pair separated by a colon If the lower or upper bounds are adjustable adj appears For open ended dimensions an asterisk appears as the upper bound Cleanscape Software FortranLint User s Manual Version 6 x 8 Cross Reference 65 The Type column shows the data type including a length specifier for symbols or the name of the associated structure for records The Kind column shows the kind parameter of the symbol if specified The Attributes column shows the attributes of each symbol Attributes include local poin
113. lable in the popup menu are as follows Lookup Selected Symbol Looks up the symbol currently highlighted in the source window Lookup Tree Routine Lint References Action 12 9 Control Panel Allows users to look up the cross reference messages related to the routine currently highlighted in the Tree window Shows cross reference information regarding the lint message highlighted in the Lint window Determines the affected windows when a double click is done on a cross reference entry The control panel bar between the Source and Lint windows has four labels that will perform various functions A description of each option follows Select Lookup Xref Filter Tree Cleanscape Software Allows the user to type in a symbol in the field next to the Select option for lookup To perform the lookup the user can either hit retum at the end of the text or click on the Lookup button Uses the highlighted text from the Source window to affect the windows selected for action by the Source window s popup menu If no text is highlighted the text specified in the Select field to the left will be used If text is entered into this Select field and lt Retum gt is pressed the entered text is used regardless of what is highlighted in the Source window Calls up a selection box to select the types of symbols to show in the Cross Reference window Any number of qualifiers may be selected Brings up a selection box to set
114. le The following sub options are supported freeform Selects a compact variable width format This is the default setting tabular Selects a fixed width 132 column format linenumbers Locations by line numbers rather than by subprogram noequiv By default the cross reference entry for a given variable includes usage information for the associated equivalences whether or not the variable is used directly noequiv suppresses equivalence usage information nolegend Suppresses the legend that describes line number usage codes filters FortranLint supports cross reference filters Filters may be used to generate cross reference tables for items that meet specific constraints For additional information see sections 8 3 and 8 4 For additional information on cross reference tables see chapter 8 FortranLint User s Manual Version 6 x 28 Y 2 7 9 3 Syntax V MS syntax LPP D escription Syntax VMS syntax NOI4 D escription Syntax VMS syntax LANG D escription Syntax V MS syntax Cleanscape Software 3 Command Reference X option Note To set cross reference options without ee a cross reference use X option followed by x XREF ERENCE option Note To set cross reference options without generating a cross reference use XRE F option followed by x Sets lines per output page To disable pagination use a
115. le is named Xlint or XLINT DAT under VMS It is strongly suggested that the original copy of this resource file not be altered If users need to modify the default configuration they should create modified copies Users may load modified versions of the resource file in various ways for additional information see section 16 2 16 2 Xlint and XLINT DAT The X lint resource file is named Xlint or XLINT DAT under VMS A copy of this file should be placed in the home directory for each X lint user By default X lint uses this copy Users may specify alternate versions on the X lint command line for additional information see section 15 3 Alternatively users may set the standard environment variable XAPPLRE SDIR or use the standard app defaults directory Under VMS two logicals DECW SYSTEM DEFAULTS and DECW USER_ DEFAULTS are used To install a copy of XLINT DAT for system wide use place it in the directory specified by DECW SYSTEM_ DEFAULTS To install acopy of XLINT DAT for use by an individual user place it in the directory specified by DECW USER_DEFAULTS for that user If X lint finds copies of the resource file in two or more places all of the specified options are used but options in individual user resource files take precedence over options in system wide resource files If a resource file is specified on the X lint command line options in the specified file take precedence For additional information see section 15 3
116. lent flint O 123 O 200 375 foo f flint O 123 200 375 foo f Under V MS these commands are equivalent flint SUPPRESS 123 SUPPRESS 200 375 foo for flint SUPPRESS 123 200 375 foo for To disable an option add an extra dash to the option switch For example w enables warning messages and w disables them To disable an option under V MS add the word NO to the option switch For example WARN enables warning messages and NOWARN disables them When an option is disabled arguments accumulated up to that point are discarded If the option is re enabled subsequently it starts over For example the following commands are equivalent flint P ANSI CRAY P P SGI foof flint P SGI foo f Under V MS these commands are equivalent flint PORT ANSI CRAY NOPORT PORT SGI foo for flint PORT SGI foo for Configuration files may be used to set default values for options The FortranLint package includes a predefined configuration file named flint cfg for additional information see section 3 3 Cleanscape Software FortranLint User s Manual Version 6 x 3 Command Reference 15 3 1 3 List of Options FortranLint options are listed below a ANSI D escription Reports non ANSI constructs If FortranLint is run in FORTRAN 77 mode this switch has the same effect as P ansi77 or PORT ansi77 If FortranLint is run in Fortran 90 95 mode this switch has the same effect as
117. lsh ISO Fortran Environment intrinsic module unixlib lbt UNIX library definitions see chapter 9 vmslib lbt VMS library definitions By default FortranLint uses the copies stored in the main FortranLint directory i e the FLINTHOME directory However if FLINTCFG is defined FortranLint searches the FLINTCFG directory for support files before it loads the default copies Users may set this variable to load customized versions of the support files FLINTCEG specifies one or more directories using the following format directory path or directory path lt SE P gt lt SE P gt directory path where lt SEP gt is for Unix for Windows or for VMS Users may define TMPDIR or SYS SCRATCH under VMS to set or change the directory where FortranLint stores its temporary files Note TMPDIR is ignored on UNIX systems that don t support the standard library routine tempnam Cleanscape Software FortranLint User s Manual Version 6 x 4 Flint Source Conventions 37 4 VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV FortranLint Source Conventions 4 1 Source Format FortranLint accepts one or more FORTRAN source files as input Each source file may contain one or more FORTRAN subprograms or program units A subprogram program unit may be a subroutine a function a block data module ora main program INCLUD E file names should not be specified explicitly on the command line
118. me of the source file the subprogram program unit name the line number the message category and severity the message number and the message text A typical message looks like this gt CALL DIPSTAT 4 CURITEM gt A demo f PRINTIT line 43 INTERFACE ERROR 59 constant is changed by subprogram Messages are generally printed in the order they appear in the source file and are grouped by subprogram program unit Each message group starts with a header consisting of a row of characters followed by subprogram program unit information The header looks like this kkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkkxkkxkxkxkxkkxkxkxkxkxkkxkxkxkxkxkkxkxkxkxkxkkkxkxkxkxkkkxkkxkxkkkxkx Subroutine PRINTIT File demo f Line 39 Additional diagnostic messages may be printed after a subprogram program unit is completely processed or after all subprograms are processed For example MPLICIT symbols were implicitly typed A AQDATA DELT USAGE ERROR local variables referenced but never set J K SYNTAX FYI unused labels 150 6 4 Statistics Output To generate statistical reports use the s option or STATISTICS under VMS Statistical reports include program size comment density and diagnostic messages summarized by number category and severity Program size statistics appear first The number of source files is shown foll
119. mon execute the following command FLINTHOME startup Users will need to run FLINTHOME STARTUP if they reboot the system or kill the detached process Alternatively add this command to the appropriate system startup script Cleanscape Software FortranLint User s Manual Version 6 x 116 Appendix B Installation under VMS 4 The startup script in step 3 requires a three minute period for initialization When the three minutes are up enter the command flint tt n FortranLint should display a help screen FORTRAN lint Rev 5 0 6 Mar 99 10 49 55 Page 1 Source configuration options Diagnostic options DLINES process debug lines ANSI ANSI compatibility EXTEND 132 column source lines FYI report FYIs FORM s source form GLOBAL global processing LANG c select language IMPLICIT flag implicit types NOIA two byte ints amp logicals PORT sys portability issues PATH path include file search path NOUSAGE suppress usage checking SYS sys target compiler system NOWARN suppress warnings SUPP n suppress message n Output control options Miscellaneous options LIST source listing FILES f filename options file INCLUDE show include files LIB f library generation mode STAT statistics MISC opt miscellaneous options WIDTH n set page width MISC help for more info LPP n set page length UNIXHELP UNIX style option help OUT redirect output to fil
120. mple flint hackers wendy jeff sara fred 3 flint lab gumby 1 Here Fred is a user name and gumby is a host name Comment lines begin with 2 iptimd 1 logfile Log file needed for usage reports recommended iptlimd m size Maximum log file size This limits the size of the log file When this size is reached the log file is copied to fileold and is cleared The size is given as a floating number followed by either m for megabytes or k for kilobytes Example m 100k m 0 5m iptlmd v Log file verbosity The default value is 3 Lower numbers produce less output and higher numbers produce more output iptimd f Run in foreground The license manager normally backgrounds itself and exits This option keeps it in the foreground Cleanscape Software FortranLint User s Manual Version 6 x 122 Appendix C License Manager Cleanscape Software FortranLint User s Manual Version 6 x Appendix D Sample Output Fortran 90 123 Appendix D VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV Sample Output Fortran 90 D 1 Sample Fortran 90 Program MODULE TYPE MYTYPE CHARACTER 10 NAME INTEGER KIND 4 SCORES 2 2 END TYPE REAL PRIVATE LOC 10 INTEGER AVE CHARACTER 2 GRADE 6 PARAMETER GRADE
121. ms the call tree by suppressing repeated subtrees This is the default mode of operation notrim may be used to disable trimming Note notrim may produce call trees that require a large amount of disk space no undefined Shows calls made to routines that are undefined in the source code or libraries 7 3 Call Tree Format The call tree displays routines subroutine calls and function references in a graphical format The starting routine is shown at the left top of the graph and each level of routine calls is shown to the right of the calling routine Each routine is connected to its called routines by lines drawn from dashes vertical bars and plus signs Within each routine calls are shown in the order they appear in the source code Routines that are not the program routine and are not called by any other routine are considered detached They will not appear in the main tree but will be shown as the head of their own detached trees Symbol Explanation name Parentheses are used to flag undefined routine name n Parentheses around a number n identify a trimmed subtree name Braces are used to mark library routine name from Ibt libraries name Square brackets are used to mark Fortran 90 internal subprogram name name Precedes calls to dummy routine name name Marks recursive chains that are chopped after the first iteration of name 7 3 1 Trimmed Trees The size of call trees grows exponentially wi
122. n FortranLint will perform a basic analysis of the source files and output the results to the console For example to analyze a single source file use a command of the form flint demo f or flint demo for under VMS The following commands will perform a more detailed analysis flint fgs demo f or flint FYI GLOBAL STATISTICS demo for under VMS Cleanscape Software FortranLint User s Manual Version 6 x 10 2 Getting Started 2 3 Managing the Output When FortranLint is used on a large program for the first time it may report hundreds or thousands of inconsistencies FortranLint has several features that simplify management of the output 2 3 1 Severity Levels If you find the number of messages too unwieldy to start with first run with just errors being reported Add w minus minus w to your command line which disables warnings warnings are enabled by default in file SFLINTHOME flint cfg Make sure you have not enabled any of the other Diagnostic options as listed on the Flint help screen Then after you have dealt with errors only remove w from your command line to reenable warnings deal with those messages and only then add other diagnostics one at a time 2 3 2 Redirection The command line option Sname or SPLIT name under VMS will cause FortranLint to redirect output from the console to the following files Analysis output name lnt Statistics S name stt Calltree t name t
123. n sections 9 2 and 9 3 respectively To use an Ibt file simply add it to the project file list If external routines are called FortranLint will search the Ibt file for applicable definitions Note FortranLint searches unixlib Ibt automatically for external routines unless the routines are found in user specified lbt files Under VMS FortranLint searches vmslib lbt instead For additional information about the search process see section 9 4 Cleanscape Software FortranLint User s Manual Version 6 x 74 9 Library Support 9 2 Writing Library Shell Files To create a library template or Ibt file start by writing a library shell file Library shell files are simply text files containing Fortran subroutine or function stubs The FortranLint package includes two sample library shell files unixlib Ish and vmslib Ish These files can be used to rebuild unixlib lbt and vmslib lbt respectively see section 9 3 They can also be used as the starting point for new library shell files Follow these guidelines a Use the filename extension Ish b Write one or more Fortran subroutine or function stubs The stubs should be named after corresponding library routines or system calls c Each stub should take the same arguments as the original routine and should declare the arguments using the appropriate types d Function stubs should have the same retum type as the original functions e Dummy
124. n started users will need to execute the command FLINTHOME STARTUP COM This will start the license daemon Note that a single iptlmd process will allow both FortranLint and X lint to run Users will need to run FLINTHOME STARTUP again if they reboot the system or kill the detached process Altematively simply add the STARTUP command to the appropriate system startup script 4 The detached process requires a three minute period after being started for initialization When the three minutes are up execute the command XLINT Xlint is now ready for use Note For license manager options see Appendix C Cleanscape Software FortranLint User s Manual Version 6 x
125. ne Options X lint supports the standard X command line options i e bg fg display etc For additional information on these options see the system vendor s X documentation Cleanscape Software FortranLint User s Manual Version 6 x 98 15 More About Xlint Additionally a database fdb file may be specified on the command line For example xlint foo fdb To specify an alternate resource file e g bar dat use an option of the following form xlint rf bar dat This option loads both the default resource file and the user specified file Options in the user specified file take precedence 15 4 Advanced Example The following session will use demo fdb as the example A screenshot of the sample session is shown in Figure 15 1 Sample session 3 1 Inthe FortranLint Xlint installation directory run xlint demo fdb This will bring up an Xlint screen with analysis output for the demo project in the Lint window 2 Click the left mouse button to bring up the File menu Select the View File command Select demo for or demo f The Source window should display FORTRAN source code for the demo project 3 Symbols can be located throughout the loaded source file by highlighting the text of asymbol in the Source window clicking the right mouse button to bring up the popup menu and selecting Next Text For instance highlight PRINT in line 9 in the Source window
126. nes Call trees normally include all calls whether or not the called routines are defined in the current input files FortranLint uses parentheses to flag undefined routines To suppress calls to undefined routines use Tnoundef or TREE NOUNDEF under VMS If these options are used call trees will be restricted to calls between routines defined in the current input files To restore the default mode of operation e g if Tnoundef was set in a configura tion file use Tundefined or TREE UN DEFINED under VMS Cleanscape Software FortranLint User s Manual Version 6 x 60 8 Cross Reference 7 4 3 Library Routines If library Ibt files are specified on the command line call trees will include calls to the associated library routines FortranLint uses curly braces to flag library calls Calls to library routines will be displayed whether or not the noundef sub option is used see section 7 4 2 However calls between library routines are not displayed in either case To generate call trees which exclude library calls use Tnolib or TREE NOLIB under V MS To restore the default mode of operation use Tlibrary or TREE LIBRARY under VMS For additional information on library files see chapter 9 7 5 Recursion FortranLint uses a pair of asterisks to flag recursive calls For example see PRINT in section 7 4 1 7 6 Dummy Routines FortranLint uses
127. nes initialized uninitialized declared undeclared Data type dimensions or common eguivalenced uneguivalenced Filtering acts on references at a subprogram program unit level filtering out the references to a symbol that match the filter criteria If all references to a symbol are filtered out the symbol itself is suppressed 3 The scope adjective if specified must be next This is used in a similar fashion to the usage adjective but relates to the scope of the symbol If the scope adjective is omitted scope is not used in determining the selection Word Antonym Description local Dummy Statement Intrinsic or Automatic dummy nondummy Dummy argument statement nonstatement Statement function intrinsic nonintrinsic Intrinsic function global Common or External common noncommon Common block or common block member external nonexternal External routine Cleanscape Software FortranLint User s Manual Version 6 x 70 8 Cross Reference 4 The class noun if specified must be next This specifies the class of the symbol The class noun describes categories of symbols If the class noun is omitted the selection contains all categories of symbols limited by the usage and scope adjectives Class Subclasses Description routines Includes programs subroutines etc programs subroutines Includes dummy subroutines functions Includes statement dummy and intrinsic functions blockdata external External routines which are
128. ng the Shift key lt Shift gt double click will cause lookups in the other windows specified for action in the Tree s popup menu The popup menu in the Tree window allows the tree root to be set from the current routine in the Source Lint or Cross Reference window Selected Routine Uses the currently highlighted routine name from the Source window or the text input field Routine Containing Lint Redisplays the Tree window with a tree centered around the routine containing the current lint message Routine Containing Xref Redisplays the Tree window with a tree centered around the routine containing the current Cross Reference entry Action Selects the affected windows when a shift double click is done on a tree routine By default the Source and Lint windows will reflect the change on the Tree window 12 8 Cross Reference Window The Cross Reference window contains a cross reference for the selected symbol Symbols may be selected by name and may contain wildcard characters The cross reference entries are filtered by the settings in the X ref Filter selection box in the Control Panel see next section The following wildcard characters are accepted zero or more characters any character Double clicking a cross reference entry calls up the source and or call tree related to that entry depending on the action settings Cleanscape Software FortranLint Users Manual Version 6 x 12 Learning About Xlint 89 Options avai
129. o90 90 OUTER is Dummy arg Ref Cleanscape Software FortranLint User s Manual arg Set Ref ER Version 6 x Vars Arrays Appendix D Sample Output Fortran 90 AVE I 4 public entity of module M in demo90 90 M is Unused in demo90 90 MAIN is Set DU Coe R 4 local in demo90 90 MAIN MAIN_INNER is I I 4 local in demo90 90 MAIN MAIN_INNER is J I 4 local in demo90 90 MAIN MAIN_INNER is LOC 10 R 4 private entity of module M in demo90 90 M is Unused OPDUM I 4 local in demo90 90 OUTER is Dummy arg STR CHAR 10 local in demo90 90 MAIN is Set SUM R 8 KIND 8 local in demo90 90 MAIN MAIN_INNER is Parameters GRADE 6 in CHAR 2 demo90 90 MAIN Cleanscape Software FortranLint User s Manual is Ref 129 Dummy arg Ref Ref Set Ref Set Ref Ref Set Initialized Version 6 x 130 D 6 Tabular Cross Reference X k SYMBOL TABLE k Functions Appendix D Sample Output FORTRAN 90 Calls References Name Class Type Definition Arguments Line Subprog Subprog File Line INT intrinsic func 14 MAIN_INNER demo90 90 13 KIND intrinsic fune I 4 MAIN_INNER demo90 90 5 M module demo90 90 line 3 OUTER demo90 90 27 MAI demo90 90 41 MAIN program dem
130. o90 90 line 38 41 M 46 M INNER 47 0UTER 49 MAIN_INNER MAIN_INNER function I 4 demo90 90 line 53 1 R 4 array R MAIN demo90 90 49 MAIN internal M_INNER subroutine demo90 90 line 16 1 type MYTYPE S MAIN demo90 90 46 M internal 2 type MYTYPE R OUTER subroutine demo90 90 line 25 1 type MYTYPE S 27 M MAIN demo90 90 47 2 type MYTYPE R 3 I 4 RO PRESENT intrinsic func L 4 OUTER demo90 90 31 SIZE intrinsic func I 4 MAIN_INNER demo90 90 6 MAIN_INNER demo90 90 7 Types Fields Name Size Field Type Kind Attributes Subprogram File References MYTYPE 26 NAME CHAR 10 M demo90 90 5 D M M INNER demo90 90 19 5 19 R SCORES I 4 2 2 4 M demo90 90 6 D Cleanscape Software FortranLint User s Manual Version 6 x Appendix D Sample Output FORTRAN 90 131 OUTER demo90 90 32 S 32 R 34 S 34 R TYPES 26 NAME CHAR 10 SCORES I 4 2 2 4 MAIN demo90 90 49 RA Vars Arrays Name Type Kind Attributes Subprogram File References AVE I 4 public entity of M demo90 90 10 D module M MAIN demo90 90 49 S DU REA ip local MAIN MAIN_INNER demo90 90 demo90 inc 3 P demo90 inc 4 D demo90 inc 6 R demo90 inc 7 R demo90 inc 9 R I I 4 local MAIN MAIN_INNER demo90 90 demo90 inc 6 RS demo90 inc 9 R J I 4 local MAIN MAIN_INNER demo90 90 demo90 inc
131. odes listed below Code Description S set R referenced used x undetermined For external and internal subroutines and functions called routines are shown If the table is in tabular format the line number of each call is shown Finally all calls to the function subroutine or F90 module are listed In the tabular cross reference the locations of the calls are shown by subprogram program unit filename and line number in the References columns Cleanscape Software FortranLint User s Manual Version 6 x 64 8 Cross Reference 8 2 4 Modules F90 only These are the symbol names from module statements The filename and the line number where the module subprogram program unit begins are shown along with the module name Modules referenced by this module are shown If the table is in tabular format the line number of each module reference is shown in the Calls column Finally all references to the module via USE association are listed In the tabular cross reference the locations of the calls are shown by subprogram program unit filename and line number in the References column 8 2 5 Common Blocks Common blocks are shown along with their size in bytes and a list of their members The routines that the common blocks appear in are shown categorized into the following groups model First instance of the common block FLINT checks subseguent occurrences of the common block against this instance same Matches the mode
132. of potential problems including e Inappropriate arguments passed to functions e Inconsistencies in common block declarations e Non portable code e Type usage conflicts across different subprograms program units e Unused functions subroutines and variables e Variables that are referenced but not set FortranLint can be used to e Check source files before they are compiled e Isolate obscure problems e Identify problems before debugging is required e Map out unfamiliar programs e Enforce programming standards The diagnostic messages produced by FortranLint are more detailed than those produced by standard compilers and cover a wider range of problems FortranLint analyzes source files both individually and as a group and can therefore identify problems that are beyond the scope of a compiler Cleanscape Software FortranLint User s Manual Version 6 x 6 1 Introduction 1 2 What s New in Version 6 Version 6 is the first major update to Flint in a decade It mainly addresses new capabilities in Fortran 2003 F03 and Fortran 2008 F08 It maps well to the state of the art in compilation primarily non object oriented compatibility Changes made are L anguage A dditions e VALUE statement and attribute e VOLATILE statement and attribute Pointer objects can now have the INTENT attribute Symbol names up to 63 characters Statements up to 256 lines 16 000 character limit for Flint Square brackets are permitte
133. ogram installation script for FortranLint license administration program license manager daemon license usage report generator Multiple versions of flint may be loaded For example flint sun4 is the executable for SUN 4 systems The installation procedure will select the correct version and rename it appropriately If the Xlint option was purchased the following additional files will be loaded demo fdb demo90 fdb xlint Xlint database generated from demo f database generated from demo90 f90 Xlint executable Xlint resource file 5 After the tape is loaded run install flint and follow the instructions on the screen 6 a Modify the user configuration for each FortranLint user as follows Set the environment variable FLIN THOST to the host name for the server where the license manager is installed To obtain the host name execute the UNIX command hostname on the server b Set the environment variable FLINTHOME to a full path for the directory which contains the FortranLint support files flint err etc Cleanscape Software FortranLint User s Manual Version 6 x 108 Appendix A Installation For example if the user is using csh use commands of the form setenv FLINTHOST hostname setenv FLINTHOME installation directory If the user is using sh use commands of the form FLINTHOST hostname export FLINTHOST FLINTHOME installation_directory export FLINTHOME Add FLINTHOME
134. on code when prompted Note A file called 02 lic or 07 lic will be created in the FortranLint installation directory This file stores information related to the activation key 3 Unix Linux only The activation procedure in step 2 also creates a script file called startup under the installation directory This file will allow users to load the daemon from the command line Users will need to run startup every time they reboot their system or kill the license manager After the key file has been successfully installed in the installation directory FortranLint will ask users if they want to put a command to start the license daemon in the system boot file etc rc local If users answer yes the license manager daemon will be started automatically whenever the system is booted To complete the installation procedure in this case simply reboot the system However users must have sufficient privileges to do so If users answer no they will need to start the daemon manually if they reboot the system or kill the daemon 4 Unix Linux only If users have elected not to have the boot file modified they need to run FLINTHOME startup at the next prompt to start the daemon After being started the daemon requires a three minute period for initialization Cleanscape Software FortranLint User s Manual Version 6 x 110 5 Appendix A Installation Enter the command flint FortranLint should display a
135. ons 2 90 and above The daemon can be started by non privileged users However root privileges are required if the product is to be installed in system directories Note The FortranLint installation directory mentioned in the following sections is the directory that contains the FortranLint support files for example flint err and flint cfg A 2 Installation Procedure Unix Linux 1 Login as system manager 2 Create a temporary directory Go to the new directory 3 Insert the tape or other media provided and enter a command of the form tar xvf deV device name Cleanscape Software FortranLint User s Manual Version 6 x Appendix A Installation 107 where device name is the UNIX device name for the media used 1 4 cartridge tapes 3 1 2 floppy diskettes etc 4 demo f demo inc demo90 f90 demo90 inc flint 1 flint cfg flint err flint hls unixlib lsh unixlib lbt vmslib lsh vmslib lbt The basic executables include demo demo90 flint flpatch install flint iptlma iptImd iptlmr Step 3 will load a number of files including demo source files demo include file demo90 source files demo90 include file man page flint default configuration file error message text flint help file standard UNIX library description text standard UNIX library file standard VMS library description text standard VMS library file demo script demo90 script FortranLint executable executable patch pr
136. or additional information see the next section 4 3 C preprocessor UNIX Windows only FortranLint supports the C preprocessor i e source files may use standard C define ifdef and include statements Source files with F filename extensions are sent through the preprocessor automatically If the command line option p is used FortranLint sends all source files through the preprocessor regardless of filename extension Preprocessor output isthen checked atthe FORTRAN level Line numbers used for error messages are translated appropriately By default FortranLint assumes that the preprocessor is usr lib cpp To use a different preprocessor run flpatch and patch the cpp parameter in the flint executable For additional information see Appendix A Cleanscape Software FortranLint Users Manual Version 6 x 4 Flint Source Conventions 39 For Windows users there is no default path One must be specified in the GUI see GUI online help or using the command line option The option switch D may be used to define symbols at the preprocessor level and the option switch I may be used to specify include directories For additional information see chapter 3 FortranLint passes the following command line arguments to the preprocessor a D and or I option switches if any b FORTRAN source file name c Output file name Note Files loa
137. ostic messages are defined in a text file named flint err This file contains one message per line in the following format HHH XX Text where is a three digit message number XX isatwo letter diagnostic code Text is the message text Example 157 SE no matching If the message number is less than three digits long it is right justified in a three column field The first letter of the diagnostic code specifies a basic error category as follows Letter Type of problem Syntax Data usage Call interface Portability Implicit typing Overflow limit exceeded OZ UTC The second letter of the diagnostic code specifies a severity level as follows Letter Type of problem E Error W Warning E Hint FYI Lines that start with an I are not diagnostic messages These lines contain information used during portability checking Cleanscape Software FortranLint User s Manual Version 6 x 144 Appendix F Diagnostic Messages F 1 Modifying the flint err file NOTE Modification of the flint err file is not recommended Rather a user should contact Cleanscape to discuss the merits of changing the severity or text content of a Flint analysis message However in certain circumstances a customer may decide modification is appropriate for their environment In such case it is recommended that the original flint err file be saved first as flint err orig Note that any changes would be lost upon installing a new version of
138. owed by the number of lines and bytes of code for the source files the include files and the total of the two Cleanscape Software FortranLint User s Manual Version 6 x 50 6 Analysis Output Number of source files 1 Source files 52 lines 1314 bytes 53 comments 953 code Include files 44 lines 1052 bytes 14 comments 86 code Total parsed 96 lines 2366 bytes 9 comments 91 code Counts on Include files reflect all appearances of the include files and will be much higher than that of the include files alone Total parsed is calculated after all include files are expanded Byte counts do not include newline characters Comment percentage is based on byte counts and takes both comment lines and inline comments into account The comment percentage for include files and total parsed is calculated after all include files are expanded This multiplies the weight of an include file comment by how many times it is included A breakdown of subprograms program units follows Total subprograns 7 Subroutines 6 Functions 0 Program 1 Block Data 0 Modules 0 Shown next is a breakdown of the messages produced Messages are sorted by freguency of appearance Displayed for each message are its category severity number freguency and message text Context dependent fields in the message text are shown as asterisks Individual message summary INTRFC ERR 57 2x too many
139. re Cross reference x namexrf Under VMS Analysis output name lnt Statistics STATISTICS namestt Call tree TREE name tre Cross reference XREF name xrf For example the following commands will analyze demo f or demo for send analysis output to demo Int and send statistics output to demo stt flint fgs demo f Sdemo flint FYI GLOBAL STAT demo for SPLIT demo under VMS 2 3 3 Statistics Output The command line option s or STATISTICS under VMS enables statistics and related output If this option is used FLINT displays a screen after analysis is completed which includes I O statistics structural statistics subroutine counts etc and a list of the error messages which occurred most freguently in the source code Cleanscape Software FortranLint User s Manual Version 6 x 2 Getting Started 11 2 3 4 Summary Mode The command line option or SUMMARY under VMS combines three operations a This option displays a progress meter that tracks the progress of FortranLint in real time b It redirects FortranLint output as explained in section 2 3 1 By default or SUMMARY redirects the output to files named flint Int flint tre etc S or SPLIT may be used to specify a different base name c It displays an error message summary as described in section 2 3 2 For example the following commands will analyze demo f or demo for display a progress meter
140. re more compact However due to limitations of the ASCII character set they are also harder to read If an extended ASCII character set with line drawing characters is available the graphics option should be used in conjunction with squish For additional information see section 7 3 5 Cleanscape Software FortranLint User s Manual Version 6 x 58 8 Cross Reference Example This is a squished tree produced by flint Tnotrim squish graphics c4 b3 c2 c3 c0 PROCDAT ETUNIT READNAME ETTYPE PRINT PRINTIT DIPSTAT PRINT GETUNIT PRINT FRINTIT DIPSTAT PRINT ETUNIT This is an unsquished version of the same tree same flint command omitting the squish and graphics options PROCDAT GETUNIT READNAME SETTYPE PRINT PRINTIT DIPSTAT PRINT GETUNIT PRINT PRINTIT DIPSTAT PRINT GETUNIT 7 3 5 Graphic Character Set By default the call tree uses the ASCII characters and to connect the routine names To specify alternate characters use Tgraphics xx xx xx xx xX or TREE GRAPHICS xx xx xx xx xx under VMS where xx entries are ASCII character codes expressed as two digit hexadecimal values The five entries are interpreted as follows a 1st code horizontal connector b 2nd code vertical connector c 3rd code T intersection d 4th code intersection e 5th code L intersection For example if the IBM ext
141. rtranLint User s Manual Version 6 x 4 Flint Source Conventions 41 4 6 Fortran 90 95 Extensions FortranLint s Fortran 90 95 support is based on the 1992 ANSI Fortran Extended Fortran 90 standard FortranLint also supports extensions implemented by the following compilers NOTE Modem compilers often offer extensions ranging from F90 to F03 e g Sun s compiler for F95 offered the BIND command so in general Flint will work best by not specifying portability options If you have a particular issue with your compiler please email support cleanscape net System Compiler Dialect code ANSI standard Fortran ANSI X3 198 1992 ANSI90 Cray Y MP UNICOS 7 0 CF90 Release 1 0 CRAY Compag Visual Fortran HP Compag DEC Fortran F90 CVS VAX Alpha OpenVMS HP DEC Fortran 90 VMS EPC EPC Fortran 90 EPC HP9000 Series HPUX FORTRAN 9000 8 05 HPUX Windows and Linux systems Lahey Fortran F90 or F95 LAHEY Silicon Graphics IRIX 6 1 MIPSpro Fortran 90 SGI SunOS Solaris Sun FORTRAN 1 4 SUN Alpha Digital UNIX OSF1 DEC Fortran 90 TRU64 In particular FortranLint supports High Performance Fortran HPF For additional information on HPF see section 4 9 Note If FortranLint is used in Fortran 90 95 mode the FORTRAN 77 extensions are supported with the exception that debugging lines are not allowed in free format 4 7 Specifying FORTRAN Dialect FortranLint normally assumes that the FORTRAN compiler running on the host system will be used To
142. s a R 8 array gt CALL READNAME CURITEM NAME CURITEM DIMENSIONS gt N demo f PROCDAT line 7 INTERFACE ERROR 287 R 4 array passed to R 8 array of larger size by 12 bytes gt IF IUNIT EQ 23 GO TO 50 N demo f PROCDAT line 11 SYNTAX WARNING 47 branch into do loop via label 50 demo f PROCDAT line 6 USAGE ERROR 126 local variable IUNIT is referenced but never set demo f PROCDAT line 3 USAGE FYI 128 local variable PUNIT declared but unused KKK K KKK KR KKK KKK KKK KKK KK KKK KKK KKK KKK KKK KKK KKK KKK KR KKK KKK KKK KKK KKK KKK KK KKK KKK KKK KKK Subroutine READNAME File demo f Line 19 demo f READNAME line 22 INTERFACE WARNING 185 common block BLOCK length mismatch compared to initial use in routine PROCDAT Cleanscape Software FortranLint User s Manual Version 6 x Appendix E Sample Output FORTRAN 77 135 demo f READNAME line 22 INTERFACE WARNING 122 common block BLOCK organization differs at member INUSE compared to initial use in routine PROCDAT KKK KKK KKK KKK KK KKK KKK KKK KKK KK KKK KKK KKK KK TH KH KK KH KK KH KK KH TH KH KH TH KH KK A KK KH KK KH KK KH TH KH KK AH KH TH AH A KH KU KU Subroutine SETTYPE File demo f Line 27 gt IF CURITEM TYPE GT 5 CALL PRINT CURITEM gt N
143. s as arguments Message numbers are shown between the category severity field and the message text Multiple instances of the same message have the same number For additional information see Appendix E O and SUPPRESS also accept the word all as an argument e g Oall or SUPPRE SS all all suppresses all numbered messages including syntax errors If message numbers or the word all are preceded with a plus sign the specified message or messages are unsuppressed E g if O201 is used to suppress message 201 O 201 will re enable it Note that an unsuppressed message will be shown only if its analysis category and level were selected Summary 0 arg SUPPRE SS arg Action n Suppress message n all Suppress all messages n Unsuppress message n all Unsuppress all messages Example O all 279 281 or SUPPRESS all 279 281 under VMS will suppress all messages but 279 and 281 Since messages 279 and 281 are interface FY Is the options gf or GLOBAL FYI must also be selected in order for these messages to be produced Cleanscape Software FortranLint User s Manual Version 6 x 46 5 Controlling Analysis 5 5 Portability Checking To check for portability problems problems that may occur when FO RTRAN code is ported to different systems use the P option or PORT under VMS P and PORT take target system nam
144. send analysis output to flint Int and display an error message summary after analysis is completed flint fg demo f or flint FYI GLOBAL SUMMARY demo for under VMS 2 4 Call Trees and Cross Reference Tables FortranLint will optionally generate a diagram of program structure i e a call tree and a symbol table cross reference For example the following commands will analyze demo f or demo for output a call tree to the file demo tre and output a cross reference to the file demo xrf flint tx demo f Sdemo or flint TREE XREF demo for SPLIT demo under VMS For additional information on call trees see chapter 7 For additional information on cross reference tables see chapter 8 Cleanscape Software FortranLint User s Manual Version 6 x 12 2 Getting Started Cleanscape Software FortranLint User s Manual Version 6 x 3 Command Reference 13 3 VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV Command Reference 3 1 Command Line Options 3 1 1 Command Format To run FortranLint use the command flint followed by zero or more option switches and one or more file names flint options file1 file2 file3 lbt file4 fdb file1 file2 are FORTRAN source files lbt files are optional call interface library files explained in chapter 9 fdb files are optional X lint database files explained in chapter 13 If no op
145. t will return 0 only unless errors are detected Cleanscape Software FortranLint User s Manual Version 6 x 52 6 Analysis Output Cleanscape Software FortranLint User s Manual Version 6 x 8 Cross Reference 53 VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV Call Trees 7 1 Overview Call trees are diagrams which outline the calling structure used by the FORTRAN input source files To generate call trees use the t option or TREE under VMS A typical call tree using the default format looks like this FORTRAN lint call tree This is a primary tree starting at the program PROCDAT PROCDAT GETUNIT READNAME SETTYPE PRINT PRINTIT DIPSTAT PRINT GETUNIT PRINT PRINTIT DIPSTAT PRINT GETUNIT 7 2 Tree Options To modify the call tree format use the T option or TREE under VMS These switches take one or more sub options as arguments specified as follows Toption 1 option2 option2 or TREE option1 option2 option2 under VMS For a list of sub options see the next section Cleanscape Software FortranLint User s Manual Version 6 x 54 8 Cross Reference 7 2 1 Arguments T and TREE accept the following sub options no alphabetic Calls are normally listed using the order in which they occur This sub option sorts call trees alphabetically The condensed option
146. te in demo UNIT I 4 local in demo UNIT1 I 4 local in demo f G PROCDAT is Ref Actual arg PRINT is Dummy arg Ref Actual arg PRINTIT is Dummy arg Ref cal READNAME is Dummy arg Set NAM FA Hy O Fh Eh Fh PROCDAT is Unused 2 5 of common BLOCK PRINTIT is Set Hh WM Fh h GETUNIT is Dummy arg Set UNIT is Dummy arg Ref E Cleanscape Software FortranLint User s Manual Version 6 x 140 E 6 Tabular Cross Reference k k SYMBOL TABLE Subroutines Appendix E Sample Output FORTRAN 77 Calls References Name Class Type Definition Arguments Line Subprog Subprog File Line DIPSTAT subroutine demo f line 48 1 I 4 S 49 PRINT PRINTIT demo f 42 2 R 4 R GETUNI subroutine demo line 14 1 I 4 S PROCDAT demo f 6 2 1 4 R PRINTIT demo f 43 PRINT subroutine demo line 33 1 struct ITEM R 35 PRINTIT PROCDAT demo f 9 2 1 4 R SETTYPE demo f 30 DIPSTA demo f 49 PRINTIT subroutine demo line 38 Lt T 4 R 42 DIPSTAT PRINT demo f 35 2 struct ITEM R 43 GETUNI PROCDAT program demo f line 2 6 GETUNIT 7 READNAME 8 SETTYPE 9 PRINT READNAME subroutine demo line 19 1 CHAR S PROCDAT demo f 7 2 R 8 array S SETTYP
147. ter pointer based and common block members Common block members are shown with the name and byte offset of the common block to which they belong The References column shows the cross reference information for each symbol The location resolution is either per subprogram program unit or per line depending on the setting of the Xlinenumbers or XREF linenumbers option when the sources are analyzed Subprogram program unit resolution will show usage within each subprogram program unit and is described in words Line resolution will show usage for each line the symbol appears on and its usage is described in single letter codes Symbol usage is described as one or more of the following Line Subprogram codes codes Description Unused Symbol was not referenced set or indeterminate A Actual arg Symbol passed as an actual argument B Array bound Symbol was used as an adjustable bound for an array D Symbol appeared in a declaration type decl dim common E Eguivalenced Appeared in an equivalence statement F SF Dummy arg Appeared as a statement function dummy argument G Ref as Label An assigned goto jumped to label assigned to this symbol Indirect Init A symbol Eguivalenced to this symbol was initialized Initialized Initialized in data statement or when given data type L Set to Label Symbol was assigned a label M Allocated Symbol was allocated N Nullified Symbol was nullified O Optl dummy arg Symbol appeared as
148. th program size It s therefore impractical to generate complete call trees for large programs As an alternative FortranLint supports trimmed call trees In trim mode FortranLint removes or trims duplicate subtrees This brings tree size down to a reasonable level At each trim point FortranLint prints a subtree number that indicates where a master copy of the associated subtree can be found To enable trim mode use the option switch T wim or TREE TRIM under VMS The configuration file provided with FortranLint includes this option FortranLint therefore uses trim mode by default Cleanscape Software FortranLint User s Manual Version 6 x 56 8 Cross Reference Example This is a trimmed tree produced by flint T trim PROCDAT GETUNIT READNAME SETTYPE PRINT 1 PRINTIT DIPSTAT PRINT GETUNIT PRINT see 1 This is an untrimmed version of the same tree produced by flint Tnotrim PROCDAT GETUNIT l READNAME l SETTYPE PRINT PRINTIT DIPSTAT PRINT GETUNIT PRINT PRINTIT DIPSTAT PRINT GETUNIT 7 3 2 Condensing Multiple Calls By default call trees show all of the calls made inside a given program If one routine calls another several times every call is displayed As an alternative FortranLint supports a condensed mode which shows the relationship between routines instead of the exact calling sequences used To prod
149. the parent and child depths of the call tree to be displayed in the Tree window as well as condensing multiple calls FortranLint User s Manual Version 6 x 90 12 Learning About Xlint Parent depth is the number of levels shown upward in the call stack in relation to the selected tree routine Child depth is similar but in a downward direction The toggle for Condense mode causes multiple calls from one routine to another to be shown as one link rather than duplicated Library includes the library routines defined in Ibt files Undefined shows all routines which are called whether or not they are defined in the current input files 12 10 Mouse Functions The functions of the mouse are consistent with standard Motif usage Left button Middle button Right button Cleanscape Software Used to select menu options and buttons can also be used to highlight or mark text in the Source window Highlighting is accomplished by pointing to the beginning of the text the user wishes to mark and while holding the left button down dragging to the end of the text and then releasing the left button Used to paste highlighted text at the current cursor location or text prompt Pasting or inserting cannot be done into the Source window Used to call up the popup menus and select the options in these menus FortranLint User s Manual Version 6 x 13 Database Files and Xlint 91 13 VVVVVVVVVVVVVVVVVVVVVVVVVVV
150. tion_directory Under VMS the qualifier system may be added to the commands in 2 and 3 to place the definitions of FLINTHOST and FLINTHOME in the system logical table Note that users need to log in with SY SNAM privileges to add definitions to the system logical table C 1 2 Administrative Commands Under VMS Description flint activate flint license activate Enter an activation key flint users flint license users Show active users outstanding licenses flint servers not supported List active license daemons flint report flint license report Produce cumulative usage report flint daily flint license daily Produce daily usage report flint kill flint license kill Kill license daemon superuser Cleanscape Software FortranLint User s Manual Version 6 x Appendix C License Manager 121 C 1 3 License Manager Options at daemon startup only 1 6 iptlmd e dirdirdir Key file directories reguired Directories must be full pathnames separated by colons iptlmd r file Reserve file This file allows licenses to be reserved for specific users or machines The format of this file is product group client1 clientn K Each group with the client members has K licenses for FortranLint If users are using UNIX based systems the group name is unrelated to the UNIX system group names It is only the name you wish to call this group of users A client is either a user name or a host name preceded by the at sign Exa
151. tions files flint quit options files under VMS 2 FortranLint needs to identify the node on which the license manager was loaded To accomplish this it uses the UNIX environment variable or VMS logical FLINTHOST To define FLINTHOST use commands of the form setenv FLINTHOST hostname for csh users or FLINTHOST hostname for sh users export FLINTHOST hostname should be the network name of the user s license server host To obtain the host name execute the command hostname on the server To define FLINTHOST under VMS use acommand of the form define FLINTHOST nodename If the license server is installed on a DECNET host nodename should be the node name of the host Otherwise nodename should be NO DECNET Cleanscape Software FortranLint User s Manual Version 6 x 120 Appendix C License Manager To obtain the node name under VMS execute the command show logical SYS N ODE on the server Discard any colon characters Another environment variable or logical FLINTHOME tells FortranLint where the installation directory is located This variable can be used to override the directory value patched into the executable during installation To define FLINTHOME use commands of the form setenv FLINTHOME directory for csh users or FLINTHOME directory for sh users export FLINTHOME directory should be a full path To define FLINTHOME under VMS use acommand of the form define FLINTHOME disk installa
152. tions or file names are specified flint will display a help screen FORTRAN source files may use any valid FORTRAN filename extension f is a special case if a source file has the f extension FortranLint will run the C preprocessor on the file before analyzing it Option switches may be specified in any order and may be intermixed with filename arguments 3 1 2 Option Format options are specified by single character switches for example x Lower case options take no arguments and may be combined into a single switch For example stx is equivalent to s t x Upper case options require one or more arguments these options cannot be combined Arguments are specified for UNIX switches as follows P argument single argument switches P argl arg2 arg3 multi argument switches Cleanscape Software FortranLint User s Manual Version 6 x 3 Command Reference Under VMS options are specified by word switches for example XREF Word switches are not case sensitive They may be abbreviated provided that the abbreviations are unique For example XREF is an abbreviation for XREFERENCE Arguments are specified for VMS switches as follows PORT argument single argument switches or PORT arg1 arg2 arg3 multi argument switches Note Under VMS switches should not include spaces Switch arguments are cumulative For example the following commands are equiva
153. ttent problems or that may make no sense e FYI or for your information messages are used to flag minor issues that may or may not be problems 5 3 Selecting Analysis Level Categories of messages may be enabled or disabled using the following options e Syntax Always enabled e Interface g or GLOBAL under VMS e Usage u or USAGE This option is on by default e Portability a or ANSI Psystn or PORTABILITY system see section 5 5 e Implicit typing m or IMPLICIT Note If global interface checking g or GLOBAL is enabled usage checking will detect a wider range of problems Severity level of messages in the above categories is controlled with the following options e Errors Always enabled e Wamings w or WARNINGS This option is on by default e FYIs f or FYI To disable a category or level add an extra dash e g w or NO e g NOWARNINGS under VMS Cleanscape Software FortranLint User s Manual Version 6 x 5 Controlling Analysis 45 Examples To perform a comprehensive analysis use the options gamf or GLOBAL ANSI IMPLICIT FYI under VMS To perform basic syntax checking use uw or NOUSAGE NOWARNINGS under V MS 5 4 Suppressing Individual Messages To suppress individual diagnostic messages use the O omit option or SUPPRESS under VMS O and SUPPRESS accept message number
154. uce condensed trees use the option Tcondensed or TREE CONDENSED under VMS This option merges multiple calls from one routine to another into a single association Example This is a condensed tree produced by flint T trim condensed PROCDAT GETUNIT READNAME SETTYPE PRINT 1 PRINTIT DIPSTAT PRINT GETUNIT READNAME PRINT see 1 Cleanscape Software FortranLint User s Manual Version 6 x 8 Cross Reference 57 This is an uncondensed version of the same tree same flint command omitting the condensed option PROCDAT GETUNIT READNAME SETTYPE PRINT 1 PRINTIT 2 DIPSTAT PRINT GETUNIT PRINTIT see 2 READNAME READNAME PRINT see 1 GETUNIT 7 3 3 Sorting Alphabetically Calls are normally shown in order of appearance To sort calls alphabetically by routine name use Talphabetical condensed or TREE ALPHA BETICAL CONDENSED under VMS Example PROCDAT GETUNIT PRINT PRINTIT DIPSTAT PRINT GETUNIT READNAME SETTYPE PRINT PRINTIT DIPSTAT PRINT GETUNIT 7 3 4 Squished Trees By default FortranLint produces call trees that are double spaced vertically This improves readability To produce single spaced trees use the option Tsquish or TREE SQUISH under VMS Note Single spaced trees a
155. x 12 Learning About Xlint 85 12 2 File Menu The File menu is used to select the database or source file A submenu with five options can be brought up by a click of the left mouse button Load Database Used to load a pre existing database A database must be loaded before symbol information can be displayed in the windows View File Used to load an arbitrary file into the Source window It will stay loaded until an action from another window calls up a different source file Save File Used to save any edits made to the file in the Source window Editing must be enabled first Enable Editing Allows the file in the Source window to be modified and saved Changes are only saved when the Save File menu item is selected When the Source window is in the editing mode the Disable E diting option replaces Enable Editing in the submenu and disallows any editing in the Source window Quit Exits X lint 12 3 Search Menu The Search menu allows text searches on the Source window using the currently highlighted text as the search string Previous Searches backwards for the selected text Next Searches forwards for the selected text Go To Line Uses the selected text as the line number and goes to that line For example if the highlighted text is the number 27 then if line 27 exists the program cursor moves to the 27th line Cleanscape Software FortranLint User s Manual Version 6 x 86 12 Learning About Xlint 12 4 Bu
156. x means that there are 7 instances of such message Shows all the actual message instances of the FortranLint source analysis Each message includes the line number the subroutine it belongs to the message number and the message itself E xample demo f 33 PRINT 125 symbols were implicitly typed as 1 4 IUNIT The Action popup menu determines which of the other windows are influenced by actions taken in the Lint window If a message is double clicked in the Lint window depending on the selections in the Action popup menu one or more of the other windows is changed to reflect the new selection The Tree window will change to reflect the routine where the message was reported The Cross Reference window will change to reflect symbol information associated with the message By default both Cross Reference and Tree are selected FortranLint User s Manual Version 6 x 88 12 Learning About Xlint 12 7 Tree Window This window contains a graphical representation of the program s call structure centered around a given routine Each node of the call tree represents a routine The selected routine is placed in the center The routines to the left and right are the predecessors and descendants of the selected routine respectively Clicking a node will highlight it and make it selectable from the popup menus of the other windows D ouble clicking a node will re center the tree around that node Double clicking a node while holdi
157. xed Specifies fixed form FORM free Specifies free form Enables statistics and related output If this option is used FLINT displays a screen after analysis is completed which includes I O statistics structural statistics subroutine counts etc and a list of the error messages that occurred most frequently in the source code S STATISTICS or SUMMARY Sends FortranLint output to a group of text files If this option is used FortranLint stores its output as follows Analysis output name int Statistics STATISTICS name stt Call tree TREE name tre Cross reference XREF namexrf Where name is specified by S name or SPLIT name VMS FortranLint User s Manual Version 6 x 24 Syntax VMS syntax See also SUMMARY 3 Command Reference S name SPLIT name or SUMMARY See at the end of this list SYSTEM See eV t TREE D escription Syntax VMS syntax See also T TREE D escription Cleanscape Software Generates a call tree i e a structural diagram of the call structure used by the source code For call tree format options see T or TREE For additional information on call trees see chapter 7 t TREE Sets call tree sub options and generates a call tree The help sub option is a special case The following sub options are supported alphabetical FortranLint normally displays sub trees
158. y be specified on the X lint command line For additional information see section 15 3 Cleanscape Software FortranLint User s Manual Version 6 x 92 13 Database Files and Xlint 13 3 Rebuilding Database Files under Xlint The Build menu on top of the Source window can be used to rebuild an existing database or to create a new one The build procedure is as follows 1 Select Configure on the Build menu Enter the database name without the fdb extension in the Database field Enter the associated source file names in the Source Files field Set the other options as desired See figure 13 1 2 Select Rebuild on the Build menu The Status field in the Control Panel may be used to monitor build status 3 When the Status field shows Rebuilding completed the new database may be loaded To do this select Use Rebuilt Database on the Build menu Users may also see the FortranLint output by using the View Build Output on the Build menu If the build failed View Build Output can be used to determine the cause For additional information see section 12 4 4 Configure source configuration _ d Process debug lines 8 132 column source lines _ 2 2 byte logicals amp ints l Run on Fortran 77 Source files demo f dialect _ ANSI 77 ANSI 90 _ CRAY _ DECNT _ DECUNIX _ DECVMS MIERE JHPIUX _ LAHEY _ NCUBE _ 0832 Jsa _JSUN Miscellaneous options
Download Pdf Manuals
Related Search
Related Contents
F10 Flussostati a paletta IT47-602 LT2534 818 User's Guide.book Untitled - TWiki - Universidade Federal da Bahia Honeywell HZ-2200 Fan User Manual PDF Gebrauchsanweisung Pulsationssystem SLK IV 300 KB User Manual - Projector Central Samsung Microondas SHINE con dorador con esmalte cerámico, 23 L Manual de Usuario Philips Special 929689819632 SMS Smart Media Solutions PD300010-P0 mounting kit Copyright © All rights reserved.
Failed to retrieve file