3 0c, 1c, 2c, 5c, 6c, 8c, kc, qc, vc \- C compilers
15 These commands compile the named C
17 into object files for the corresponding architecture.
18 If there are multiple C
20 the compilers will attempt to keep
22 compilations running concurrently.
23 Associated with each compiler is a string
30 little-endian MIPS 3000 family
42 AMD64 and compatibles (e.g., Intel EM64T)
45 Intel i386, i486, Pentium, etc.
54 big-endian MIPS 3000 family
56 The compilers handle most preprocessing directives themselves; a complete
57 preprocessor is available in
59 which must be run separately.
61 Let the first letter of the compiler name be
73 The output object files end in
75 The letter is also the prefix of related programs:
80 Plan 9 conventionally sets the
82 environment variable to the
84 string appropriate to the current machine's type.
85 Plan 9 also conventionally has
87 directories, which contain among other things:
89 for machine-dependent include files;
91 for public object code libraries;
99 The compiler options are:
106 (allowed only if there is just one input file).
107 Default is to take the last element of the input file name,
114 Print warning messages about unused variables, etc.
117 Accept functions without a new-style
118 ANSI C function prototype.
119 By default, the compilers reject functions
120 used without a defined prototype,
121 although ANSI C permits them.
133 If no definition is given, the name is defined as
137 Enable type-checking of calls to
139 and other formatted print routines. See the discussion
140 of extensions, below.
145 file whose name does not begin with
147 or is enclosed in double quotes
149 sought first in the directory
152 argument. If this fails,
155 flag is given or the name is enclosed in
158 in directories named in
164 .BR /$objtype/include .
167 Suppress the automatic searching for include files in
168 the directory of the file argument.
171 Suppress automatic registerization and optimization.
174 Print an assembly language version of the object code
175 on standard output as well as generating the
180 Pass type signatures on all external and global entities.
181 The signature is based on the C
186 By default, the compilers are non-standardly lax about type equality between
188 values and other pointers; this flag requires ANSI C conformance.
191 Invoke a standard ANSI C preprocessor before compiling.
194 Instead of compiling, print on standard output acid functions (see
196 for examining structures declared in the source files.
201 except suppress information about structures
202 declared in included header files.
209 places acid functions in
213 and not on standard output.
215 The compilers support several extensions to ANSI C:
220 A structure or union may contain unnamed substructures and subunions.
221 The fields of the substructures or
222 subunions can then be used as if they were members of the parent
223 structure or union (the resolution of a name conflict is unspecified).
224 When a pointer to the outer structure or union is used in a context
225 that is only legal for the unnamed substructure, the compiler promotes
226 the type and adjusts the pointer value to point at the substructure.
227 If the unnamed structure or union is of a type with a tag name specified by a
230 the unnamed structure or union can be explicitly referenced
231 by <struct variable>.<tagname>.
234 A structure value can be formed with an expression such as
236 (struct S){v1, v2, v3}
238 where the list elements are values for the fields of struct
242 Array initializers can specify the indices of the array in square
245 int a[] = { [3] 1, [10] 5 };
247 which initializes the third and tenth elements of the eleven-element array
251 Structure initializers can specify the structure element by using the name
252 following a period, as
254 struct { int x; int y; } s = { .y 1, .x 5 };
256 which initializes elements
262 These forms also accept the new ANSI C notation, which includes an equal sign:
264 int a[] = { [3] = 1, [10] = 5 };
265 struct { int x; int y; } s = { .y = 1, .x = 5 };
269 A global variable can be dedicated to a register
274 modules and libraries.
281 #pragma lib "libbio.a"
283 records that the program needs to be loaded with file
284 .BR /$objtype/lib/libbio.a ;
285 such lines, typically placed in library header files, obviate the
287 option of the loaders. To help identify files in non-standard directories,
288 within the file names in the
292 represents the name of the architecture
297 represents its identifying character
306 #pragma varargck argpos error 2
308 tells the compiler that the second argument to
314 that identifies the handling of subsequent arguments.
318 #pragma varargck type "s" char*
320 says that the format verb
322 processes an argument of type
327 #pragma varargck flag 'c'
336 option is enabled, to type-check calls to
338 and other such routines.
343 with any of the following forms:
345 #pragma incomplete \fItype\fP
346 #pragma incomplete struct \fItag\fP
347 #pragma incomplete union \fItag\fP
353 name for a structure or union type, and
355 is a structure or union tag,
356 tells the compiler that
357 the corresponding type
358 should have its signature calculated as an incomplete type
359 even if it is subsequently fully defined.
360 This allows the type signature mechanism to work in the presence
361 of opaque types declared in header files, with their full definitions
362 visible only to the code which manipulates them.
363 With some imported software it might be necessary to turn off the
364 signature generation completely for a large body of code (typically
365 at the start and end of a particular include file).
370 signature generation is turned off; if
374 the compiler will generate signatures.
380 is accepted as well as the normal
389 variables as a 64-bit type.
390 The standard header typedefs this to
394 values is usually emulated by a run-time library,
397 only division and modulus use the run-time library
398 and the other operators generate in-line code
401 .I division-or-modulus
402 .BI "(1<<" constant )
403 will turn into in-line bit operations,
404 as is done for shorter
408 For the 68020, produce a program
417 2l -o prog main.2 sub.2
420 .TF /$objtype/include
423 system area for machine-independent
428 system area for machine-dependent
432 .TF /sys/src/cmd/2c,\ etc.
435 machine-independent part
437 .BR /sys/src/cmd/2c ,\ etc.
438 machine-dependent part
451 ``How to Use the Plan 9 C Compiler''
453 The list of compilers given above is only partial,
454 not all architectures are supported on all systems,
455 some have been retired and some
456 are provided by third parties.
458 The default preprocessor only handles
466 For a full ANSI preprocessor, use
471 The default search order for include files
475 Some features of C99, the 1999 ANSI C standard,
479 expressions may not be either signedness of
481 on 32-bit architectures
485 The implementation of
487 assignment can use a static location
488 and this can be disturbed by interrupts