home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / gnu / gccdist / gcc-src / vms / gcc.rnh < prev    next >
Encoding:
Text File  |  1992-06-11  |  18.6 KB  |  598 lines

  1. .!
  2. .!    RUNOFF source file for GCC.HLP 
  3. .!
  4. .!    This is a RUNOFF input file which will produce a VMS help file
  5. .!    for the VMS HELP library.
  6. .!
  7. .!    Date of last revision: April 8, 1992
  8. .!
  9. .!
  10. .!    Eric Youngdale
  11. .!
  12. .literal
  13. .end literal
  14. .no paging
  15. .no flags all
  16. .right margin 70
  17. .left margin 1
  18.  
  19. .indent -1
  20. 1 GCC
  21. .skip
  22.  The GCC command invokes the GNU C compiler.
  23. .skip
  24. .literal
  25.       GCC file-spec
  26. .end literal
  27. .skip
  28. .indent -1
  29. 2 Parameters
  30. .skip
  31.  file-spec
  32. .skip
  33.      A C source file.  If no input file extension is specified, GNU C 
  34.      assumes .C as the default extension unless the /PLUS qualifier is given,
  35.      in which case .CC is assumed as the default extension.
  36. .skip
  37.      If an extension of .CPP is given, then the source file is assumed to be
  38.      the output of the preprocessor, and thus the preprocessor is not executed.
  39. .skip
  40.      If an extension of .S is given, then the source file is assumed to be
  41.      the assembly code output of the compiler, and only the assembler is called
  42.      to generate an object file.
  43.  
  44. .skip
  45. .indent -1
  46. 2 Qualifiers
  47. .skip
  48.  
  49.  GNU C command qualifiers modify the way the compiler handles the
  50.  compilation.
  51. .skip
  52.  The following is the list of available qualifiers for GNU C:
  53. .literal
  54.  
  55.       /[NO]CASE_HACK            (default is /Case_Hack)
  56.       /CC1_OPTIONS=("option"[,"option"...]])
  57.       /[NO]DEBUG                (default is /noDebug)
  58.       /DEFINE=("identifier[=definition]"[,...])
  59.       /[NO]G_FLOAT
  60.       /INCLUDE_DIRECTORY=(path[,path...]])
  61.       /[NO]LIST[=filename]
  62.       /[NO]MACHINE_CODE[=filename]
  63.       /[NO]OBJECT[=filename]
  64.       /[NO]OPTIMIZE[=n]         (default is /Optimize=1)
  65.       /NAMES[=option]
  66.       /[NO]PLUS_PLUS            (default is /noPlus_Plus)
  67.       /PREPROCESS_ONLY[=filename]
  68.       /PROFILE[=identifier]
  69.       /SCAN=(file[,file...])
  70.       /SHOW[=option]
  71.       /[NO]STANDARD[=option]
  72.       /TARGET=machine
  73.       /UNDEFINE=("identifier"[,"identifier",...])
  74.       /[NO]VERBOSE[=option]
  75.       /VERSION
  76.       /WARNINGS
  77. .end literal
  78. .skip
  79. .indent -1
  80. 2 Linking
  81. .skip
  82.  
  83.  When linking programs compiled with GNU C, you should include the GNU
  84.  C library before the VAX C library.  For example,
  85. .skip
  86. .literal
  87.   LINK object-file,GNU_CC:[000000]GCCLIB/LIB,SYS$LIBRARY:VAXCRTL/LIB
  88. .end literal
  89. .skip
  90.  You can also link your program with the shared VAX C library.  This
  91.  can reduce the size of the .EXE file, as well as make it smaller
  92.  when it's running.  For example,
  93. .skip
  94. .literal
  95.   $ LINK object-file, GNU_CC:[000000]GCCLIB/LIB,SYS$INPUT/OPT
  96.   SYS$SHARE:VAXCRTL/SHARE
  97. .end literal
  98. .skip
  99.  (If you use the second example and type it in by hand, be sure to type
  100.  ^Z after the last carriage return).  A simpler alternative would be to
  101.  place the single line:
  102. .skip
  103. .literal
  104.   SYS$SHARE:VAXCRTL/SHARE
  105. .end literal
  106. .skip
  107.  into a file called VAXCRTL.OPT, and then use the link command:
  108. .skip
  109. .literal
  110.   $ LINK object-file, GNU_CC:[000000]GCCLIB/LIB,VAXCRTL.OPT/OPT
  111. .end literal
  112. .skip
  113.  If a program has been compiled with /G_FLOAT, then the linking
  114.  instructions are slightly different.  If you are linking with the
  115.  non-shared library, then the command that you should use would be:
  116. .skip
  117. .literal
  118.   LINK object-file,GNU_CC:[000000]GCCLIB/LIB,SYS$LIBRARY:VAXCRTLG/LIB -
  119.                 ,SYS$LIBRARY:VAXCRTL/LIB
  120. .end literal
  121. .skip
  122.  Note that both VAXCRTL and VAXCRTLG must be linked to.  If you are using
  123.  the shared VAX C library, then you should use a command like:
  124. .skip
  125. .literal
  126.   $ LINK object-file, GNU_CC:[000000]GCCLIB/LIB,SYS$INPUT:/OPTIONS
  127.   SYS$SHARE:VAXCRTLG/SHARE
  128. .end literal
  129. .skip
  130.  In the case of the sharable library, only one library needs to be linked
  131.  to.
  132. .skip
  133.  If you need to link to libg++, it is easiest to use the command procedure 
  134.  supplied with libg++ to link your program.
  135. .skip
  136. .indent -1
  137. 2 /CASE_HACK 
  138. .skip
  139. .literal
  140.   /[NO]CASE_HACK      D=/CASE_HACK
  141. .end literal
  142. .skip
  143.  Although the VMS Linker and Librarian are case sensitive with respect
  144.  to symbol names, traditionally compilers have generated external
  145.  symbols which were uppercase only.  By default GCC generates uppercase
  146.  symbols, but a "case-hack" is appended to a symbol name when the
  147.  symbol contains any upper case characters (unless it also contains
  148.  one or more dollar sign characters).  This allows symbols whose spelling
  149.  differs only in case to be used together in the same program.  The
  150.  dollar sign exception makes it easier to deal with VMS run-time libraries.
  151. .skip
  152.  There are cases where this is undesirable (mainly when using certain
  153.  applications where modules have been precompiled, perhaps in another
  154.  language)  and we want to compile without case hacking. In these
  155.  cases the /NOCASE_HACK switch disables case hacking.
  156. .skip
  157.  The /NAMES qualifier supercedes /CASE_HACK.
  158. .skip
  159. .indent -1
  160. 2 /CC1_OPTIONS
  161. .skip
  162.  
  163.  This specifies additional switches to the compiler itself which cannot
  164.  be set by means of the compiler driver.
  165. .skip
  166. .indent -1
  167. 2 /DEBUG
  168. .skip
  169.  
  170.  /DEBUG includes additional information in the object file output so
  171.  that the program can be debugged with the VAX Symbolic Debugger.
  172. .skip
  173.  To use the debugger it is also necessary to link the debugger to your
  174.  program, which is done by specifying the /DEBUG qualifier to the link
  175.  command. With the debugger it is possible to set breakpoints, examine
  176.  variables, and set variables to new values.  See the VAX Symbolic
  177.  Debugger manual for more information, or type "HELP" from the debugger
  178.  prompt.
  179. .skip
  180. .indent -1
  181. 2 /DEFINE
  182. .skip
  183. .literal
  184. /DEFINE=(identifier[=definition][,...])
  185. .end literal
  186. .skip
  187.  /DEFINE defines a string or macro ('definition') to be substituted 
  188.  for every occurrence of a given string ('identifier') in a program.
  189.  It is equivalent to the #define preprocessor directive.
  190. .skip
  191.  All definitions and identifiers are converted to uppercase unless they
  192.  are in quotation marks.
  193. .skip
  194.  The simple form of the /DEFINE qualifier:
  195. .skip
  196. .literal
  197.    /DEFINE=vms
  198. .end literal
  199. .skip
  200.  results in a definition equivalent to the preprocessor directive:
  201. .skip
  202. .literal
  203.  #define VMS 1
  204. .end literal
  205. .skip
  206.  You must enclose macro definitions in quotation marks, as in this
  207.  example:
  208. .skip
  209. .literal
  210.  /DEFINE="C(x)=((x) & 0xff)"
  211. .end literal
  212. .skip
  213.  This definition is the same as the preprocessor definition:
  214. .skip
  215. .literal
  216.  #define C(x) ((x) & 0xff)
  217. .end literal
  218. .skip
  219.  If more than one /DEFINE is present on the GCC command line, only
  220.  the last /DEFINE is used.
  221. .skip
  222.  If both /DEFINE and /UNDEFINE are present on a command line, /DEFINE
  223.  is evaluated before /UNDEFINE.
  224. .skip
  225. .indent -1
  226. 2 /G_FLOAT
  227. .skip
  228.  
  229.  Instructs the compiler to use "G" floating point arithmetic instead of
  230.  "D". The difference is that double precision has a range of
  231.  approximately +/-0.56e-308 to +/-0.9 e+308, with approximately 15
  232.  decimal digits precision.
  233. .skip
  234.  "D" floating point has the same range as single precision floating
  235.  point, with approximately 17 decimal digits precision.
  236. .skip
  237.  If you use the /G_FLOAT qualifier, the linking instructions are
  238.  different. See "Linking" for further details.
  239. .skip
  240. .indent -1
  241. 2 /LIST
  242. .skip
  243.    /LIST[=list_file_name]
  244. .skip
  245.  This does not generate a listing file in the usual sense, however it
  246.  does direct the compiler to save the preprocessor output.  If a file is
  247.  not specified, then this output is written into a file with
  248.  the same name as the source file and an extension of .CPP.
  249. .skip
  250. .indent -1
  251. 2 /INCLUDE_DIRECTORY
  252. .skip
  253. .literal
  254.  /INCLUDE_DIRECTORY=(path [,path...])
  255. .end literal
  256. .skip
  257.  
  258.  The /INCLUDE_DIRECTORY qualifier provides additional directories to
  259.  search for user-defined include files.  'path' can be either a 
  260.  logical name or a directory specification.
  261. .skip
  262.  There are two forms for specifying include files - #include "file-spec"
  263.  and #include <file-spec>.  For the #include "file-spec" form, the search
  264.  order is:
  265. .skip
  266. .literal
  267.  1.  The directory containing the source file.
  268.  
  269.  2.  The directories in the /INCLUDE qualifier (if any).
  270.  
  271.  3.  The directory (or directories) specified in the logical name
  272.      GNU_CC_INCLUDE.
  273.  
  274.  4.  The directory (or directories) specified in the logical name
  275.      SYS$LIBRARY.
  276.  
  277.  For the #include <file-spec> form, the search order is:
  278.  
  279.  1.  The directories specified in the /INCLUDE qualifier (if any).
  280.  
  281.  2.  The directory (or directories) specified in the logical name
  282.      GNU_CC_INCLUDE.
  283.  
  284.  3.  The directory (or directories) specified in the logical name
  285.      SYS$LIBRARY.
  286.  
  287. .end literal
  288. .indent -1
  289. 2 /MACHINE_CODE
  290. .skip
  291.     /[NO]MACHINE_CODE[=filename]
  292. .skip
  293.  
  294.  Tells GNU C to output the machine code generated by the compiler. The
  295.  machine code is output to the filename specified, or to a file with the
  296.  same name as the input file,
  297.  with the extension .S.  An object file is still generated, unless /NOOBJ
  298.  is also specified.
  299. .skip
  300.  The default is /NOMACHINE_CODE, which causes the intermediate assembler
  301.  file to be written to SYS$SCRATCH:file.S and then deleted upon completion
  302.  of the compilation.
  303. .skip
  304. .indent -1
  305. 2 /OBJECT
  306. .skip
  307. .literal
  308.   /OBJECT[=filename]
  309.   /NOOBJECT
  310. .end literal
  311. .skip
  312.  
  313.  Controls whether or not an object file is generated by the compiler.
  314. .skip
  315.  The default is /OBJECT unless /PREPROCESS_ONLY is specified.
  316. .skip
  317. .indent -1
  318. 2 /OPTIMIZE
  319. .skip
  320.     /[NO]OPTIMIZE[=n]
  321. .skip
  322.  
  323.  Controls whether optimization is performed by the compiler.  By default,
  324.  optimization is on.  /NOOPTIMIZE turns optimization off.
  325.  
  326.  You can also specify the level of optimization with /OPTIMIZE=n, where
  327.  0 <= n <= 2.  The case n=0 is equivalent to /NOOPTIMIZE, and the default is
  328.  /OPTIMIZE=1.
  329.  
  330. .skip
  331. .indent -1
  332. 2 /NAME
  333. .skip
  334.     /NAME[=option]
  335. .skip
  336.  
  337.     Controls the mapping of symbol names.  Possible options are 
  338. HEX_SUFFIX (default), LOWER, UPPER, and MIXED.  The /NOCASE_HACK switch
  339. is equivalent to the /NAME=UPPER switch.
  340. .skip
  341. .indent -1
  342. 2 /PLUS_PLUS
  343. .literal
  344.     /[NO]PLUS_PLUS
  345. .end literal
  346. .skip
  347.  
  348.    Instructs the compiler driver to use the GNU-C++ compiler instead of the
  349.  GNU-C compiler.  Note that the default extension of source files is .CC when
  350.  this qualifier is in effect.
  351. .skip
  352.    The default is /NOPLUS_PLUS, indicating a normal C compilation.
  353. .skip
  354. .indent -1
  355. 2 /PREPROCESS_ONLY
  356. .literal
  357.     /[NO]PREPROCESS_ONLY[=filename]
  358. .end literal
  359. .skip
  360.    Instructs the compiler to execute only the preprocessing phase of
  361.  compilation.  If filename is not specified then the name used will be
  362.  the base portion of the input file with .CPP as the filetype.
  363. .skip
  364.    This is similar to /LIST, except that it also implies /NOOBJECT
  365.  and /NOMACHINE_CODE.
  366. .skip
  367. .indent -1
  368. 2 /PROFILE
  369. .skip
  370.   /PROFILE[=identifier]
  371. .skip
  372.  
  373.    Instructs the compiler to generate function profiling code.  You must
  374.  link your program to the profiler when you use this options.
  375.  The profile statistics are automatically printed out on the terminal during
  376.  image exit. (i.e. no modifications to your source file are required in
  377.  order to use the profiler).
  378. .skip
  379.    There are three identifiers that can be used with the /PROFILE switch.
  380.  These are ALL, FUNCTION, and BLOCK.  If /PROFILE is given without an
  381.  identifier, then FUNCTION is assumed. 
  382. .skip
  383. .indent -1
  384. 3 Block_Profiler
  385. .skip
  386.  
  387.    The block profiler counts how many times control of the program passes
  388.  certain points in your program.  This is useful in determining which
  389.  portions of a program would benefit from recoding for optimization.
  390. .skip
  391.    The report for the block profiler contains the function name, file name,
  392.  PC, and the source file line number as well as the count of how many times
  393.  control has passed through the specified source line.
  394. .skip
  395. .indent -1
  396. 3 Function_Profiler
  397. .skip
  398.  
  399.    The function profiler counts how many times each function is entered, and
  400.  keeps track of how much CPU time is used within each function.
  401. .skip
  402.    You should be careful about interpreting the results of profiles where
  403.  there are inline functions.  When a function is included as inline, then 
  404.  there is no call to the internal data collection routine used by the
  405.  profiler, and thus there will be no record of this function being called.
  406.  The compiler does generate a callable version of each inline function, and
  407.  if this called version is used, then the profiler's data collection routine
  408.  will be called.
  409. .skip
  410. .indent -1
  411. 2 /SCAN
  412. .skip
  413.   /SCAN=(file[,file...])
  414. .skip
  415.  
  416.   This qualifier supplies a list of files that will be read as input, and
  417.   the output will be discarded before processing the regular input file.
  418.   Because the output generated from the files is discarded, the only effect
  419.   of this qualifier is to make the macros defined in the files available
  420.   for use in the main input.
  421. .skip
  422. .indent -1
  423. 2 /SHOW
  424. .skip
  425.   /SHOW[=option]
  426. .skip
  427.  
  428.   This causes the preprocessor to generate information other than the
  429.   preprocessed input file.  When this qualifier is used, no assembly code
  430.   and no object file is generated.
  431. .skip
  432.   The output of the preprocessor is placed in the file specified by the /LIST
  433.   qualifier, if present.  If the /LIST qualifier is not present, then the
  434.   output is placed in a file with the same name as the input file with an
  435.   extension that depends upon which option that is selected.
  436. .skip
  437. .indent -1
  438. 3 DEFINITIONS
  439. .skip
  440.  
  441.   This option causes the preprocessor to dump a list of all of the definitions
  442.  to the output file.  This is useful for debugging purposes, since it lets you
  443.  determine whether or not everything has been defined properly.
  444. .skip
  445.  If the default file name is used for the output, the extension will be .DEF.
  446. .skip
  447. .indent -1
  448. 3 RULES
  449. .skip
  450.  
  451.   This option causes the preprocessor to output a rule suitable for MAKE,
  452.  describing the dependencies of the main source file.  The preprocessor outputs
  453.  one MAKE rule containing the object file name for that source file, a colon,
  454.  and the names of all the concluded files.  If there are many included files 
  455.  then the rule is split into several lines using the '\'-newline.
  456. .skip
  457.    When using this option, only files included with the "#include "file"
  458.  directive are mentioned.
  459. .skip
  460.  If the default file name is used for the output, a null extension will be
  461.  used.
  462. .skip
  463. .indent -1
  464. 3 ALL
  465. .skip
  466.  
  467.   This option is similar to RULES, except that it also mentions files included
  468.  with the "#include <file.h>" directive.
  469. .skip
  470.  If the default file name is used for the output, a null extension will be
  471.  used.
  472. .skip
  473. .indent -1
  474. 2 /STANDARD
  475. .literal
  476.     /STANDARD[=option]
  477.     /NOSTANDARD
  478. .end literal
  479. .skip
  480.  
  481.  Controls use of GCC's -traditional, -ansi, and -pedantic options.
  482.  The available options are PORTABLE and [NO]ANSI.
  483.  /STANDARD=PORTABLE causes the ``-ansi -pedantic''
  484.  switch combination to be used.  /STANDARD=ANSI is equivalent to
  485.  /STANDARD, and causes ``-ansi'' to be used.  /STANDARD=NOANSI is
  486.  equivalent omitting /STANDARD altogether, and is the default.  No
  487.  special switches are used by the compiler in that case.
  488. .skip
  489.  Specifying /NOSTANDARD is different from simply omitting /STANDARD;
  490.  it causes the ``-traditional'' switch to be used.
  491. .skip
  492.  See the GCC manual for the implications of these compiler switches.
  493. .skip
  494. .indent -1
  495. 2 /UNDEFINE
  496. .skip
  497.  /UNDEFINE cancels a macro definition.  Thus, it is the same as the
  498.  #undef preprocessor directive.
  499. .skip
  500.  If more than one /UNDEFINE is present on the GCC command line, only
  501.  the last /UNDEFINE is used.
  502. .skip
  503.  If both /DEFINE and /UNDEFINE are present on a command line, /DEFINE
  504.  is evaluated before /UNDEFINE.
  505. .skip
  506. .indent -1
  507. 2 /TARGET=machine
  508. .skip
  509.   Directs the compiler driver to look in a subdirectory (going by the 
  510.   machine name) for compiler binaries.  This can be used for cross-
  511.   compilation  or this can be used to maintain several different versions
  512.   of gcc on the system simultaneously.
  513. .skip
  514. .indent -1
  515. 2 /VERBOSE
  516. .literal
  517.     /[NO]VERBOSE[=(option,...)]
  518. .end literal
  519. .skip
  520.  
  521.  Available options are ALL, ECHO, VERIFY (equivalent to ECHO),
  522.  STATISTICS, and NONE.  /VERBOSE=NONE is equivalent to /NOVERBOSE, which
  523.  is the default.  /VERBOSE is equivalent to /VERBOSE=ALL,
  524.  which in turn is equivalent to /VERBOSE=(ECHO,STATISTICS).
  525. .skip
  526.  /VERBOSE=ECHO causes DCL verification to be used by the compiler driver
  527.  routine while it invokes each separate phase of compilation (preprocessor,
  528.  compiler proper, and assembler back-end).
  529. .skip
  530.  /VERBOSE=STATISTICS causes GCC to provide some tracing information
  531.  (source function names) as it progresses, and also to provide internal
  532.  timing statistics when it completes the primary compilation phase.
  533. .skip
  534.  /NOVERBOSE supresses the warning messages about debug being specified
  535.  while optimization is enabled.
  536. .skip
  537. .indent -1
  538. 2 /VERSION
  539. .skip
  540.  
  541.  Causes the driver, preprocessor and the compiler to identify themselves
  542.  by their
  543.  version numbers, and in the case of the compiler, the version number of the
  544.  compiler that built it.
  545. .skip
  546. .indent -1
  547. 2 /WARNINGS
  548. .skip
  549.  When this qualifier is present, warnings about usage that should be avoided
  550.  are given by the compiler.  For more information, see "Using and Porting GNU
  551.  CC", in the section on command line options, under "-Wall".
  552. .skip
  553.  Warnings are also generated by the preprocessor when this qualifier is given.
  554. .skip
  555. .indent -1
  556. 2 Known_Incompatibilities_with_VAX-C
  557. .skip
  558. There are several known incompatibilities between GNU-C and VAX-C.
  559. Some common ones will be briefly described here. A complete 
  560. description can be found in "Using and Porting GNU CC" in the chapter entitled
  561. "Using GNU CC on VMS".
  562. .skip
  563. .indent 4
  564. GNU-C provides case hacking as a means of giving case
  565. sensitivity to symbol names.  The case hack is a hexadecimal
  566. number appended to the symbol name, with a bit being set for
  567. each upper case letter.  Symbols with all lower case, or
  568. symbols that have a dollar sign ("$") are not case hacked.
  569. There are times that this is undesirable, namely when you
  570. wish to link your program against a precompiled library
  571. which was compiled with a non-GNU-C compiler. X-windows
  572. (or DECWindows) is an example of this.  In these instances,
  573. the /NOCASE_HACK switch should be used.
  574. .skip
  575. If you require case hacking in some cases, but not in others (i.e.
  576. Libg++ with DECWindows), then it is recommended that you develop a header file
  577. which will define all mixed case functions that should not have a case hack as 
  578. the lower case equivalents.
  579. .skip
  580. .indent 4
  581. GNU-C does not provide the globaldef and globalref mechanism
  582. which is used by VAX-C to coerce the VMS linker to include certain object
  583. modules from a library.  There are  assembler hacks, which are
  584. available to the user through the macros defined in gnu_hacks.h, which
  585. effectively give you the ability to perform these functions.  While
  586. not syntactically identical, they do provide most of the functionality.
  587. .skip
  588. Note that globaldefs of enums is not supported in the way that it is
  589. under VAX-C.  This can be easily simulated, however, by globaldefing
  590. an integer variable, and then globalvaluing all of the enumerated
  591. states.
  592. .skip
  593. Furthermore, the way that globalvalue is currently implemented, the
  594. data type of the globalvalue variable is seen to the compiler to be a
  595. pointer to the data type that you specify.  This is necessary in order
  596. to make the compiler correctly address the globalvalue variables.
  597. .left margin 1
  598.