3 0c, 1c, 2c, 5c, 6c, 7c, 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)
48 Intel i386, i486, Pentium, etc.
57 big-endian MIPS 3000 family
59 The compilers handle most preprocessing directives themselves; a complete
60 preprocessor is available in
62 which must be run separately.
64 Let the first letter of the compiler name be
77 The output object files end in
79 The letter is also the prefix of related programs:
84 Plan 9 conventionally sets the
86 environment variable to the
88 string appropriate to the current machine's type.
89 Plan 9 also conventionally has
91 directories, which contain among other things:
93 for machine-dependent include files;
95 for public object code libraries;
103 The compiler options are:
110 (allowed only if there is just one input file).
111 Default is to take the last element of the input file name,
118 Print warning messages about unused variables, etc.
121 Accept functions without a new-style
122 ANSI C function prototype.
123 By default, the compilers reject functions
124 used without a defined prototype,
125 although ANSI C permits them.
137 If no definition is given, the name is defined as
141 Enable type-checking of calls to
143 and other formatted print routines. See the discussion
144 of extensions, below.
149 file whose name does not begin with
151 or is enclosed in double quotes
153 sought first in the directory
156 argument. If this fails,
159 flag is given or the name is enclosed in
162 in directories named in
168 .BR /$objtype/include .
171 Suppress the automatic searching for include files in
172 the directory of the file argument.
175 Suppress automatic registerization and optimization.
178 Print an assembly language version of the object code
179 on standard output as well as generating the
184 Pass type signatures on all external and global entities.
185 The signature is based on the C
192 By default, the compilers are non-standardly lax about type equality between
194 values and other pointers; this flag requires ANSI C conformance.
197 Invoke a standard ANSI C preprocessor before compiling.
200 Instead of compiling, print on standard output acid functions (see
202 for examining structures declared in the source files.
207 except suppress information about structures
208 declared in included header files.
215 places acid functions in
219 and not on standard output.
221 The compilers support several extensions to ANSI C:
226 A structure or union may contain unnamed substructures and subunions.
227 The fields of the substructures or
228 subunions can then be used as if they were members of the parent
229 structure or union (the resolution of a name conflict is unspecified).
230 When a pointer to the outer structure or union is used in a context
231 that is only legal for the unnamed substructure, the compiler promotes
232 the type and adjusts the pointer value to point at the substructure.
233 If the unnamed structure or union is of a type with a tag name specified by a
236 the unnamed structure or union can be explicitly referenced
237 by <struct variable>.<tagname>.
240 A structure value can be formed with an expression such as
242 (struct S){v1, v2, v3}
244 where the list elements are values for the fields of struct
248 Array initializers can specify the indices of the array in square
251 int a[] = { [3] 1, [10] 5 };
253 which initializes the third and tenth elements of the eleven-element array
257 Structure initializers can specify the structure element by using the name
258 following a period, as
260 struct { int x; int y; } s = { .y 1, .x 5 };
262 which initializes elements
268 These forms also accept the new ANSI C notation, which includes an equal sign:
270 int a[] = { [3] = 1, [10] = 5 };
271 struct { int x; int y; } s = { .y = 1, .x = 5 };
275 A global variable can be dedicated to a register
280 modules and libraries.
287 #pragma lib "libbio.a"
289 records that the program needs to be loaded with file
290 .BR /$objtype/lib/libbio.a ;
291 such lines, typically placed in library header files, obviate the
293 option of the loaders. To help identify files in non-standard directories,
294 within the file names in the
298 represents the name of the architecture
303 represents its identifying character
312 #pragma varargck argpos error 2
314 tells the compiler that the second argument to
320 that identifies the handling of subsequent arguments.
324 #pragma varargck type "s" char*
326 says that the format verb
328 processes an argument of type
333 #pragma varargck flag 'c'
342 option is enabled, to type-check calls to
344 and other such routines.
349 with any of the following forms:
351 #pragma incomplete \fItype\fP
352 #pragma incomplete struct \fItag\fP
353 #pragma incomplete union \fItag\fP
359 name for a structure or union type, and
361 is a structure or union tag,
362 tells the compiler that
363 the corresponding type
364 should have its signature calculated as an incomplete type
365 even if it is subsequently fully defined.
366 This allows the type signature mechanism to work in the presence
367 of opaque types declared in header files, with their full definitions
368 visible only to the code which manipulates them.
369 With some imported software it might be necessary to turn off the
370 signature generation completely for a large body of code (typically
371 at the start and end of a particular include file).
376 signature generation is turned off; if
380 the compiler will generate signatures.
386 is accepted as well as the normal
395 variables as a 64-bit type.
396 The standard header typedefs this to
400 values is usually emulated by a run-time library,
403 only division and modulus use the run-time library
404 and the other operators generate in-line code
407 .I divison-or-modulus
408 .BI "(1<<" constant )
409 will turn into in-line bit operations,
410 as is done for shorter
414 For the 68020, produce a program
423 2l -o prog main.2 sub.2
426 .TF /$objtype/include
429 system area for machine-independent
434 system area for machine-dependent
438 .TF /sys/src/cmd/2c,\ etc.
441 machine-independent part
443 .BR /sys/src/cmd/2c ,\ etc.
444 machine-dependent part
457 ``How to Use the Plan 9 C Compiler''
459 The list of compilers given above is only partial,
460 not all architectures are supported on all systems,
461 some have been retired and some
462 are provided by third parties.
464 The default preprocessor only handles
472 For a full ANSI preprocessor, use
477 The default search order for include files
481 Some features of C99, the 1999 ANSI C standard,
485 expressions may not be either signedness of
487 on 32-bit architectures
491 The implementation of
493 assignment can use a static location
494 and this can be disturbed by interrupts