3 The GCC command invokes the GNU C compiler.
11 A C source file. If no input file extension is specified, GNU C
12 assumes .C as the default extension unless the /PLUS qualifier is
13 given, in which case .CC is assumed as the default extension.
15 If an extension of .CPP is given, then the source file is assumed to
16 be the output of the preprocessor, and thus the preprocessor is not
19 If an extension of .S is given, then the source file is assumed to be
20 the assembly code output of the compiler, and only the assembler is
21 called to generate an object file.
25 GNU C command qualifiers modify the way the compiler handles the
28 The following is the list of available qualifiers for GNU C:
31 /CC1_OPTIONS=(option [,option...]])
33 /DEFINE=(identifier[=definition][,...])
35 /INCLUDE_DIRECTORY=(path [,path...]])
42 /SCAN=(file[,file...])
44 /UNDEFINE=(identifier[,identifier,...])
51 When linking programs compiled with GNU C, you should include the GNU
52 C library before the VAX C library. For example,
54 LINK object-file,GNU_CC:[000000]GCCLIB/LIB,SYS$LIBRARY:VAXCRTL/LIB
56 You can also link your program with the shared VAX C library. This
57 can reduce the size of the .EXE file, as well as make it smaller when
58 it's running. For example,
60 $ LINK object-file, GNU_CC:[000000]GCCLIB/LIB,SYS$INPUT/OPT
61 SYS$SHARE:VAXCRTL/SHARE
63 (If you use the second example and type it in by hand, be sure to
64 type ^Z after the last carriage return). A simpler alternative would
65 be to place the single line:
67 SYS$SHARE:VAXCRTL/SHARE
69 into a file called VAXCRTL.OPT, and then use the link command:
71 $ LINK object-file, GNU_CC:[000000]GCCLIB/LIB,VAXCRTL.OPT/OPT
73 If a program has been compiled with /G_FLOAT, then the linking
74 instructions are slightly different. If you are linking with the
75 non-shared library, then the command that you should use would be:
77 LINK object-file,GNU_CC:[000000]GCCLIB/LIB,SYS$LIBRARY:VAXCRTLG/LIB -
78 ,SYS$LIBRARY:VAXCRTL/LIB
80 Note that both VAXCRTL and VAXCRTLG must be linked to. If you are
81 using the shared VAX C library, then you should use a command like:
83 $ LINK object-file, GNU_CC:[000000]GCCLIB/LIB,SYS$INPUT:/OPTIONS
84 SYS$SHARE:VAXCRTLG/SHARE
86 In the case of the sharable library, only one library needs to be
91 /[NO]CASE_HACK D=/CASE_HACK
93 Since the VMS Linker and Librarian are not case sensitive with
94 respect to symbol names, a "case-hack" is appended to a symbol name
95 when the symbol contains upper case characters.
97 There are cases where this is undesirable, (mainly when using certain
98 applications where modules have been precompiled, perhaps in another
99 language) and we want to compile without case hacking. In these
100 cases the /NOCASE_HACK switch disables case hacking.
104 This specifies additional switches to the compiler itself which
105 cannot be set by means of the compiler driver.
109 /DEBUG includes additional information in the object file output so
110 that the program can be debugged with the VAX Symbolic Debugger.
112 To use the debugger it is also necessary to link the debugger to your
113 program, which is done by specifying the /DEBUG qualifier to the link
114 command. With the debugger it is possible to set breakpoints,
115 examine variables, and set variables to new values. See the VAX
116 Symbolic Debugger manual for more information, or type "HELP" from
121 /DEFINE=(identifier[=definition][,...])
123 /DEFINE defines a string or macro ('definition') to be substituted
124 for every occurrence of a given string ('identifier') in a program.
125 It is equivalent to the #define preprocessor directive.
127 All definitions and identifiers are converted to uppercase unless
128 they are in quotation marks.
130 The simple form of the /DEFINE qualifier:
134 results in a definition equivalent to the preprocessor directive:
138 You must enclose macro definitions in quotation marks, as in this
141 /DEFINE="C(x)=((x) & 0xff)"
143 This definition is the same as the preprocessor definition:
145 #define C(x) ((x) & 0xff)
147 If more than one /DEFINE is present on the GCC command line, only the
148 last /DEFINE is used.
150 If both /DEFINE and /UNDEFINE are present on a command line, /DEFINE
151 is evaluated before /UNDEFINE.
155 Instructs the compiler to use "G" floating point arithmetic instead
156 of "D". The difference is that double precision has a range of
157 approximately +/-0.56e-308 to +/-0.9 e+308, with approximately 15
158 decimal digits precision.
160 "D" floating point has the same range as single precision floating
161 point, with approximately 17 decimal digits precision.
163 If you use the /G_FLOAT qualifier, the linking instructions are
164 different. See "Linking" for further details.
168 /LIST[=list_file_name]
170 This does not generate a listing file in the usual sense, however it
171 does direct the compiler to save the preprocessor output. If a file
172 is not specified, then this output is written into a file with the
173 same name as the source file and an extension of .CPP.
177 /INCLUDE_DIRECTORY=(path [,path...])
179 The /INCLUDE_DIRECTORY qualifier provides additional directories to
180 search for user-defined include files. 'path' can be either a
181 logical name or a directory specification.
183 There are two forms for specifying include files - #include
184 "file-spec" and #include <file-spec>. For the #include "file-spec"
185 form, the search order is:
187 1. The directory containing the source file.
189 2. The directories in the /INCLUDE qualifier (if any).
191 3. The directory (or directories) specified in the logical name
194 4. The directory (or directories) specified in the logical name
197 For the #include <file-spec> form, the search order is:
199 1. The directories specified in the /INCLUDE qualifier (if any).
201 2. The directory (or directories) specified in the logical name
204 3. The directory (or directories) specified in the logical name
209 Tells GNU C to output the machine code generated by the compiler.
210 The machine code is output to a file with the same name as the input
211 file, with the extension .S. An object file is still generated,
212 unless /NOOBJ is also specified.
219 Controls whether or not an object file is generated by the
226 Controls whether optimization is performed by the compiler. By
227 default, optimization is on. /NOOPTIMIZE turns optimization off.
231 Instructs the compiler driver to use the GNU-C++ compiler instead of
232 the GNU-C compiler. Note that the default extension of source files
233 is .CC when this qualifier is in effect.
237 /PROFILE[=identifier]
239 Instructs the compiler to generate function profiling code. You must
240 link your program to the profiler when you use this options. The
241 profile statistics are automatically printed out on the terminal
242 during image exit. (i.e. no modifications to your source file are
243 required in order to use the profiler).
245 There are three identifiers that can be used with the /PROFILE
246 switch. These are ALL, FUNCTION, and BLOCK. If /PROFILE is given
247 without an identifier, then FUNCTION is assumed.
251 The block profiler counts how many times control of the program
252 passes certain points in your program. This is useful in determining
253 which portions of a program would benefit from recoding for
256 The report for the block profiler contains the function name, file
257 name, PC, and the source file line number as well as the count of how
258 many times control has passed through the specified source line.
262 The function profiler counts how many times each function is entered,
263 and keeps track of how much CPU time is used within each function.
265 You should be careful about interpreting the results of profiles
266 where there are inline functions. When a function is included as
267 inline, then there is no call to the internal data collection routine
268 used by the profiler, and thus there will be no record of this
269 function being called. The compiler does generate a callable version
270 of each inline function, and if this called version is used, then the
271 profiler's data collection routine will be called.
275 /SCAN=(file[,file...])
277 This qualifier supplies a list of files that will be read as input,
278 and the output will be discarded before processing the regular input
279 file. Because the output generated from the files is discarded, the
280 only effect of this qualifier is to make the macros defined in the
281 files available for use in the main input.
287 This causes the preprocessor to generate information other than the
288 preprocessed input file. When this qualifier is used, no assembly
289 code and no object file is generated.
291 The output of the preprocessor is placed in the file specified by the
292 /LIST qualifier, if present. If the /LIST qualifier is not present,
293 then the output is placed in a file with the same name as the input
294 file with an extension that depends upon which option that is
299 This option causes the preprocessor to dump a list of all of the
300 definitions to the output file. This is useful for debugging
301 purposes, since it lets you determine whether or not everything has
302 been defined properly.
304 If the default file name is used for the output, the extension will
309 This option causes the preprocessor to output a rule suitable for
310 MAKE, describing the dependencies of the main source file. The
311 preprocessor outputs one MAKE rule containing the object file name
312 for that source file, a colon, and the names of all the concluded
313 files. If there are many included files then the rule is split into
314 several lines using the '\'-newline.
316 When using this option, only files included with the "#include "file"
317 directive are mentioned.
319 If the default file name is used for the output, a null extension
324 This option is similar to RULES, except that it also mentions files
325 included with the "#include <file.h>" directive.
327 If the default file name is used for the output, a null extension
332 /UNDEFINE cancels a macro definition. Thus, it is the same as the
333 #undef preprocessor directive.
335 If more than one /UNDEFINE is present on the GCC command line, only
336 the last /UNDEFINE is used.
338 If both /DEFINE and /UNDEFINE are present on a command line, /DEFINE
339 is evaluated before /UNDEFINE.
343 Controls whether the user sees the invocation command strings for the
344 preprocessor, compiler, and assembler. The compiler also outputs
345 some statistics on time spent in its various phases.
349 Causes the preprocessor and the compiler to identify themselves by
350 their version numbers, and in the case of the compiler, the version
351 number of the compiler that built it.
355 When this qualifier is present, warnings about usage that should be
356 avoided are given by the compiler. For more information, see "Using
357 and Porting the GNU Compiler Collection (GCC)", in the section on
358 command line options, under "-Wall".
360 Warnings are also generated by the preprocessor when this qualifier
363 2 Known_Incompatibilities_with_VAX-C
365 There are several known incompatibilities between GNU-C and VAX-C.
366 Some common ones will be briefly described here. A complete
367 description can be found in "Using and Porting the GNU Compiler
368 Collection (GCC)" in the chapter entitled "Using GCC on VMS".
370 GNU-C provides case hacking as a means of giving case sensitivity
371 to symbol names. The case hack is a hexadecimal number appended to
372 the symbol name, with a bit being set for each upper case letter.
373 Symbols with all lower case, or symbols that have a dollar sign ("$")
374 are not case hacked. There are times that this is undesirable,
375 namely when you wish to link your program against a precompiled
376 library which was compiled with a non-GNU-C compiler. X-windows (or
377 DECWindows) is an example of this. In these instances, the
378 /NOCASE_HACK switch should be used.
380 If you require case hacking in some cases, but not in others (i.e.
381 Libg++ with DECWindows), then it is recommended that you develop a
382 header file which will define all mixed case functions that should
383 not have a case hack as the lower case equivalents.
385 GNU-C does not provide the globaldef and globalref mechanism
386 which is used by VAX-C to coerce the VMS linker to include certain
387 object modules from a library. There are assembler hacks, which are
388 available to the user through the macros defined in gnu_hacks.h,
389 which effectively give you the ability to perform these functions.
390 While not syntactically identical, they do provide most of the
393 Note that globaldefs of enums is not supported in the way that it is
394 under VAX-C. This can be easily simulated, however, by globaldefing
395 an integer variable, and then globalvaluing all of the enumerated
398 Furthermore, the way that globalvalue is currently implemented, the
399 data type of the globalvalue variable is seen to the compiler to be a
400 pointer to the data type that you specify. This is necessary in
401 order to make the compiler correctly address the globalvalue