LCC(1) LCC(1)
NAME
lcc − ANSI C compiler
SYNOPSIS
lcc [ option | file ]...
DESCRIPTION
lcc is an ANSI C compiler for a variety of platforms.
Arguments whose names end with ‘.c’ (plus ‘.C’ under Windows) are taken to be C source programs; they
are preprocessed, compiled, and each object program is left on the file whose name is that of the source
with ‘.o’ (UNIX) or ‘.obj’ (Windows) substituted for the extension. Arguments whose names end with ‘.i’
are treated similarly, except they are not preprocessed. In the same way, arguments ending with ‘.s’ (plus
‘.S’, ‘.asm’, and ‘.ASM’, under Windows) are taken to be assembly source programs and are assembled,
producing an object file. If there are no arguments, lcc summarizes its options on the standard error.
lcc deletes an object file if and only if exactly one source file is mentioned and no other file (source, object,
library) or −l option is mentioned.
If the environment variable LCCINPUTS is set, lcc assumes it gives a semicolon- or colon-separated list of
directories in which to look for source and object files whose names do not begin with ‘/’. These directo-
ries are also added to the list of directories searched for libraries. If LCCINPUTS is defined, it must con-
tain ‘.’ in order for the current directory to be searched for input files.
lcc uses ANSI standard header files (see ‘FILES’ below). Include files not found in the ANSI header files
are taken from the normal default include areas, which usually includes /usr/include. Under Windows, if
the environment variable include is defined, it gives a semicolon-separated list of directories in which to
search for header files.
lcc interprets the following options; unrecognized options are taken as loader options (see ld(1)) unless −c,
−S,or−E precedes them. Except for −l, all options are processed before any of the files and apply to all of
the files. Applicable options are passed to each compilation phase in the order given.
−c Suppress the loading phase of the compilation, and force an object file to be produced even if only
one program is compiled.
−g Produce additional symbol table information for the local debuggers. lcc warns when −g is unsup-
ported.
−Wf−gn,x
Set the debugging level to n and emit source code as comments into the generated assembly code;
x must be the assembly language comment character. If n is omitted, it defaults to 1, which is sim-
ilar to −g. Omitting ,x just sets the debugging level to n.
−w Suppress warning diagnostics, such as those announcing unreferenced statics, locals, and parame-
ters. The line #pragma ref id simulates a reference to the variable id.
−dn Generate jump tables for switches whose density is at least n, a floating point constant between
zero and one. The default is 0.5.
−A Warns about declarations and casts of function types without prototypes, assignments between
pointers to ints and pointers to enums, and conversions from pointers to smaller integral types. A
second −A warns about unrecognized control lines, nonANSI language extensions and source
characters in literals, unreferenced variables and static functions, declaring arrays of incomplete
types, and exceeding some ANSI environmental limits, like more than 257 cases in switches. It
also arranges for duplicate global definitions in separately compiled files to cause loader errors.
−P Writes declarations for all defined globals on standard error. Function declarations include proto-
types; editing this output can simplify conversion to ANSI C. This output may not correspond to
the input when there are several typedefs for the same type.
−n Arrange for the compiler to produce code that tests for dereferencing zero pointers. The code
reports the offending file and line number and calls abort(3).
local − $Date: 1998/08/24 21:14:33 $ 1