home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / fchek284.zip / dcl2inc.doc < prev    next >
Text File  |  1995-06-22  |  4KB  |  133 lines

  1.  
  2.  
  3.  
  4.      DCL2INC(1)                 March (12)                  DCL2INC(1)
  5.  
  6.  
  7.  
  8.      NAME
  9.           dcl2inc - postprocess ftnchek .dcl files to create separate
  10.           INCLUDE files
  11.  
  12.      SYNOPSIS
  13.           dcl2inc *.dcl
  14.  
  15.      DESCRIPTION
  16.           dcl2inc postprocessing declaration files output by
  17.           ftnchek(1), replacing unique COMMON block definitions by
  18.           Fortran INCLUDE statements.  For each input .dcl file, a
  19.           modified output .dcn file is produced, together with include
  20.           files named by the COMMON block name, with filename
  21.           extension .inc.
  22.  
  23.           In addition, dcl2inc produces on stdout a list of Makefile
  24.           dependencies for the UNIX make(1) utility.  These can be
  25.           appended to the project Makefile to ensure that any
  26.           subsequent changes to .inc files provoke recompilation of
  27.           source files that include them.
  28.  
  29.           dcl2inc warns about COMMONs which differ from their first
  30.           occurrence, and simply copies them to the output .dcn file,
  31.           instead of replacing them with an INCLUDE statement.  Thus,
  32.           any COMMON statements that are found in the output .dcn
  33.           files should be examined carefully to determine why they
  34.           differ: they may well be in error.
  35.  
  36.           Replication of identical data, and bugs arising from
  37.           subsequent modification of only part of it, is a significant
  38.           reason why Fortran programming projects should require that
  39.           COMMON declarations occur in separate include files, so that
  40.           there is only a single point of definition of any global
  41.           object.
  42.  
  43.           Even though the Fortran INCLUDE statement was tragically
  44.           omitted from the 1977 Standard, it has long been implemented
  45.           by virtually all compiler vendors, and is part of the 1990
  46.           Standard.  In practice, there is therefore no portability
  47.           problem associated with use of INCLUDE statements, provided
  48.           that one avoids nonportable file names.  As long as the code
  49.           obeys Fortran's limit of six-character alphanumeric names,
  50.           the filenames generated by dcl2inc will be acceptable on all
  51.           current popular operating systems.
  52.  
  53.           Fortran's default, or IMPLICIT, variable typing is
  54.           deprecated in modern programming languages, because it
  55.           encourages sloppy documentation, and worse, bugs due to
  56.           misspelled variables, or variables that have been truncated
  57.           because they extend past column 72.  If all variables used
  58.           are explicitly typed, and a compiler option is used to
  59.           reject all program units with untyped variables, variable
  60.  
  61.  
  62.  
  63.      Page 1                                          (printed 6/22/95)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      DCL2INC(1)                 March (12)                  DCL2INC(1)
  71.  
  72.  
  73.  
  74.           spelling and truncation errors can be eliminated.
  75.  
  76.           Variable declarations that have been produced automatically
  77.           by a tool like ftnchek(1) or pfort(1) have a consistent
  78.           format that facilitates application of stream editors (e.g.
  79.           to change array dimensions or rename variables), and simple
  80.           floating-point precision conversion tools like d2s(1),
  81.           dtoq(1), dtos(1), qtod(1), s2d(1), and stod(1).
  82.  
  83.      CAVEAT
  84.           The current version (2.8.2) of ftnchek(1) does not produce
  85.           Fortran EQUIVALENCE statements in .dcl files, so you must be
  86.           careful to preserve them when replacing original
  87.           declarations with new ones from .dcl or .dcn files.
  88.  
  89.      SEE ALSO
  90.           d2s(1), dtoq(1), dtos(1), ftnchek(1), make(1), pfort(1),
  91.           qtod(1), s2d(1), stod(1).
  92.  
  93.      AUTHOR
  94.           Nelson H. F. Beebe, Ph.D.
  95.           Center for Scientific Computing
  96.           Department of Mathematics
  97.           University of Utah
  98.           Salt Lake City, UT 84112
  99.           Tel: +1 801 581 5254
  100.           FAX: +1 801 581 4148
  101.           Email: <beebe@math.utah.edu>
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.      Page 2                                          (printed 6/22/95)
  130.  
  131.  
  132.  
  133.