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
190 By default, the compilers are non-standardly lax about type equality between
192 values and other pointers; this flag requires ANSI C conformance.
195 Invoke a standard ANSI C preprocessor before compiling.
198 Instead of compiling, print on standard output acid functions (see
200 for examining structures declared in the source files.
205 except suppress information about structures
206 declared in included header files.
213 places acid functions in
217 and not on standard output.
219 The compilers support several extensions to ANSI C:
224 A structure or union may contain unnamed substructures and subunions.
225 The fields of the substructures or
226 subunions can then be used as if they were members of the parent
227 structure or union (the resolution of a name conflict is unspecified).
228 When a pointer to the outer structure or union is used in a context
229 that is only legal for the unnamed substructure, the compiler promotes
230 the type and adjusts the pointer value to point at the substructure.
231 If the unnamed structure or union is of a type with a tag name specified by a
234 the unnamed structure or union can be explicitly referenced
235 by <struct variable>.<tagname>.
238 A structure value can be formed with an expression such as
240 (struct S){v1, v2, v3}
242 where the list elements are values for the fields of struct
246 Array initializers can specify the indices of the array in square
249 int a[] = { [3] 1, [10] 5 };
251 which initializes the third and tenth elements of the eleven-element array
255 Structure initializers can specify the structure element by using the name
256 following a period, as
258 struct { int x; int y; } s = { .y 1, .x 5 };
260 which initializes elements
266 These forms also accept the new ANSI C notation, which includes an equal sign:
268 int a[] = { [3] = 1, [10] = 5 };
269 struct { int x; int y; } s = { .y = 1, .x = 5 };
273 A global variable can be dedicated to a register
278 modules and libraries.
285 #pragma lib "libbio.a"
287 records that the program needs to be loaded with file
288 .BR /$objtype/lib/libbio.a ;
289 such lines, typically placed in library header files, obviate the
291 option of the loaders. To help identify files in non-standard directories,
292 within the file names in the
296 represents the name of the architecture
301 represents its identifying character
310 #pragma varargck argpos error 2
312 tells the compiler that the second argument to
318 that identifies the handling of subsequent arguments.
322 #pragma varargck type "s" char*
324 says that the format verb
326 processes an argument of type
331 #pragma varargck flag 'c'
340 option is enabled, to type-check calls to
342 and other such routines.
347 with any of the following forms:
349 #pragma incomplete \fItype\fP
350 #pragma incomplete struct \fItag\fP
351 #pragma incomplete union \fItag\fP
357 name for a structure or union type, and
359 is a structure or union tag,
360 tells the compiler that
361 the corresponding type
362 should have its signature calculated as an incomplete type
363 even if it is subsequently fully defined.
364 This allows the type signature mechanism to work in the presence
365 of opaque types declared in header files, with their full definitions
366 visible only to the code which manipulates them.
367 With some imported software it might be necessary to turn off the
368 signature generation completely for a large body of code (typically
369 at the start and end of a particular include file).
374 signature generation is turned off; if
378 the compiler will generate signatures.
384 is accepted as well as the normal
393 variables as a 64-bit type.
394 The standard header typedefs this to
398 values is usually emulated by a run-time library,
401 only division and modulus use the run-time library
402 and the other operators generate in-line code
405 .I division-or-modulus
406 .BI "(1<<" constant )
407 will turn into in-line bit operations,
408 as is done for shorter
412 For the 68020, produce a program
421 2l -o prog main.2 sub.2
424 .TF /$objtype/include
427 system area for machine-independent
432 system area for machine-dependent
436 .TF /sys/src/cmd/2c,\ etc.
439 machine-independent part
441 .BR /sys/src/cmd/2c ,\ etc.
442 machine-dependent part
455 ``How to Use the Plan 9 C Compiler''
457 The list of compilers given above is only partial,
458 not all architectures are supported on all systems,
459 some have been retired and some
460 are provided by third parties.
462 The default preprocessor only handles
470 For a full ANSI preprocessor, use
475 The default search order for include files
479 Some features of C99, the 1999 ANSI C standard,
483 expressions may not be either signedness of
485 on 32-bit architectures
489 The implementation of
491 assignment can use a static location
492 and this can be disturbed by interrupts