|
Index for Section 1 |
|
|
Alphabetical listing for C |
|
|
Bottom of page |
|
c89(1)
NAME
c89 - Standard C Compiler
SYNOPSIS
c89 [-c] [-D name [=value]]... [-E] [-g] [-I directory]... [-L
directory]... [-o outfile] [-O] [-s] [-U name]... file...
STANDARDS
Interfaces documented on this reference page conform to industry standards
as follows:
c89: XPG4, XPG4-UNIX
Refer to the standards(5) reference page for more information about
industry standards and associated tags.
OPTIONS
The following options are defined by the XPG4-UNIX standard. However, the
compiler can also recognize the options defined in cc(1). Unlike cc(1), c89
includes the -std1 option by default (for ANSI C standards checking). To
check for full compliance to XPG4-UNIX, you must also specify
-D_XOPEN_SOURCE_EXTENDED. See standards(5) for more information.
-c Suppress the loading phase of the compilation and force an object file
to be produced.
-g Produce symbol table information for full symbolic debugging and
suppress optimizations that limit full symbolic debugging. Symbol
types and stack-frame variables names are available. Global
optimizations are not performed. Instruction scheduling does not span
source line boundaries. Trap instructions are inserted to ensure that
exceptions are reported on the source lines that caused them to be
generated.
-s Remove the symbol table and relocation bits to save space (this impairs
the usefulness of the debuggers). This information can also be removed
by strip(1).
-o output
Name the final output file output. If this option is used, the file
a.out is undisturbed.
-D name[=def]
Define the name as if with a #define statement. If no definition is
given, the name is defined as 1.
-E Run only the C macro preprocessor on the files and send the result to
the standard output device.
-I dir
Specifies that #include files whose names do not begin with / are
always sought first in the directory of the file argument, then in
directories specified in -I options, and finally in the standard
directory, /usr/include.
-L directory
Adds dir to the list of directories that are searched for libraries.
Directories specified with -L are searched before the standard
directories.
-O Enable global optimization, including code motion, strength reduction
and test replacement, split lifetime analysis, and code scheduling.
-U name
Remove any definition of name previously defined with the -D option.
DESCRIPTION
Compiles source code in conformance with the XPG4-UNIX standard.
The c89 command can process one or more of the following types of "file"
arguments:
· Files whose names end with .c are assumed to be C source programs.
They are compiled, and each object program is left in the file whose
name consists of the last component of the source with .o substituted
for .c. The .o file is deleted only when a single source program is
compiled and linked in a single step.
· Files whose names end with .a are assumed to be libraries of object
files. These files are passed directly to the linker.
· Files whose names end with .o are assumed to be object files produced
by a previous c89 command. These files are also passed directly to
the linker.
The c89 command can take other types of file arguments, although they are
not part of the standard specification. See cc(1) for a description of the
other file types.
When the compiler is invoked, it defines the following C preprocessor
macros that identify the language of the input files and the environments
in which the code can run:
__LANGUAGE_C__
__unix__
__osf__
__alpha
_SYSTYPE_BSD
LANGUAGE_ASSEMBLY
__LANGUAGE_ASSEMBLY__
You can reference these macros in #ifdef statements to isolate code that
applies to a particular language or environment.
ERRORS
The diagnostics produced by c89 are intended to be self-explanatory.
Occasional messages may be produced by the assembler or loader.
EXAMPLES
1. Compiles helloworld.c and produces the executable file helloworld.c
c89 -o helloworld helloworld.c
2. Compiles helloworld.c and creates the object file helloworld.o.
c89 -c helloworld.c
3. Compiles a.c and b.c, producing a.o and b.o. The object files main.o,
a.o, and b.o are then linked together, using the library /a/b/c/libQ.a
to resolve any references in a.o, and /a/b/c/libp.a to resolve any
references in b.o. The executable program is placed in the file
a.out. Only one -L option is needed because libQ.a and libp.a reside
in the same directory.
c89 -L /a/b/c main.o a.c -l Q b.c -l p
ENVIRONMENT VARIABLES
The following environment variables affect compiler operation:
LANG
Provides a default value for locale variables that are not set. If any
of these variables contains an invalid setting, the compiler behaves as
if none were set.
LC_ALL
If set to a non-empty string, this variable overrides values in all
locale variables, including LANG.
LC_CTYPE
Determines the locale for the interpretation of sequences of bytes of
text data as characters (for example, single-byte characters instead of
multi-byte characters in arguments and input files).
LC_MESSAGES
Determines the locale used for diagnostic messages.
NLSPATH
Determines the locale of message catalogs for the processing of
LC_MESSAGES.
TMPDIR
Provides a pathname that overrides the default directory for temporary
files, if any.
For more information on these environment variables, see i18n_intro(5) and
l10n_intro(5).
FILES
file.c
Input file
file.o
Object file
a.out
Loaded output
err.english.cc
Compiler error messages in English
/tmp/ctm?
Temporary
/usr/lib/cmplrs/cc/comp.config
Compiler configuration file (optional)
/usr/lib/cmplrs/cc/cfe
C front end
/usr/lib/cmplrs/cc/cpp
C macro preprocessor
/usr/lib/cmplrs/cc/gemc_cc
DEC C compiler
/usr/lib/cmplrs/cc/ujoin
Binary ucode and symbol table joiner
/usr/bin/uld
Ucode loader
/usr/lib/cmplrs/cc/usplit
Binary ucode and symbol table splitter
/usr/lib/cmplrs/cc/umerge
Procedure integrator
/usr/lib/cmplrs/cc/uopt
Optional global ucode optimizer
/usr/lib/cmplrs/cc/om
Post-link optimizer
/usr/lib/cmplrs/cc/ugen
Code generator
/usr/lib/cmplrs/cc/as0
Symbolic to binary assembly language translator
/usr/lib/cmplrs/cc/as1
Binary assembly language assembler and reorganizer
/usr/lib/cmplrs/cc/crt0.o
Run-time startup
/usr/lib/cmplrs/cc/mcrt0.o
Startup for profiling
/usr/ccs/lib/libc.a
Standard library, see intro(3)
/usr/lib/cmplrs/cc/libprof1.a
Level 1 profiling library
/usr/include
Standard directory for #include files
/usr/lib/cmplrs/cc/ftoc
Interface between prof and cord
/usr/lib/cmplrs/cc/cord
Procedure rearranger
/usr/bin/btou
Binary-to-symbolic ucode translator
/usr/bin/utob
Symbolic-to-binary ucode translator
mon.out
File produced for analysis by prof
gmon.out
File produced for analysis by gprof
SEE ALSO
Commands: as(1), cc(1), ld(1)
Other: i18n_intro(5), l10n_intro(5), standards(5)
Guides: ANSI X3.159-1989
B. W. Kernighan and D. M. Ritchie, The C Programming Language
B. W. Kernighan, Programming in C -- a tutorial
D. M. Ritchie, C Reference Manual
Programmer's Guide
Assembly Language Programmer's Guide
Compaq C Language Reference Manual
|
Index for Section 1 |
|
|
Alphabetical listing for C |
|
|
Top of page |
|