cc(1)
NAME
cc − C compiler
SYNOPSIS
cc [ options ] files
DESCRIPTION
cc (also called hc) accepts several types of file arguments:
Arguments whose names end with .c are taken to be C source programs; they are compiled, and each object program is left on the file whose name is that of the source with .o substituted for .c. The .o file is normally deleted, however, if a single C program is compiled and loaded all at one go.
In the same way, arguments whose names end with .s are taken to be assembly source programs and are assembled, producing a .o file.
The following options are interpreted by cc. See ld(1) for load-time options.
−c Suppress the loading phase of the compilation, and force an object file to be produced even if only one program is compiled.
−g Have the compiler produce additional symbol table information for the debugger dbx(1).
−T symtab_size
Have the compiler allocate symtab_size elements in its symbol table. The default size is 3,000 elements.
−w Suppress warning diagnostics.
−p Arrange for the compiler to produce code which counts the number of times each routine is called. If loading takes place, replace the standard startup routine by one which automatically calls monitor(3C) at the start and arranges to write out a mon.out file at normal termination of execution of the object program. An execution profile can then be generated by use of prof(1).
−G Same as the −p option, except it arranges to write out a gmon.out file for the use of gprof(1). The −G option implies the −p option.
−O Invoke an object-code improver.
−R Pass the -r option to as, making initialized variables shared and read-only.
−S Compile the named C programs, and leave the assembler-language output on corresponding files suffixed .s.
−J Invoke the long-jump assembler ljas rather than as.
−K Treat the proposed ANSI standard keyword volatile as a normal identifier. If this option is not used, volatile is accepted as a type specifier, but it has no effect on the code that is generated.
−F Use old-style structure and union alignments and sizes. By default, structure and union elements are aligned as follows:
| type | byte alignment |
| char | 1 |
| short | 2 |
| int | 4 |
| long | 4 |
| float | 4 |
| double | 8 |
The entire structure or union is aligned on a byte boundary equal to its most restrictive member’s alignment. The size of a structure or a union is a multiple of this most restrictive alignment. Pre-CX/UX 5.0 versions of cc aligned structures and double entities on 4-byte boundaries, and the size of a structure or union was always a multiple of 4 bytes. This option applies the pre-CX/UX 5.0 interpretation to structures and unions.
−E Run only the macro preprocessor on the named C programs, and send the result to the standard output.
−C Prevent the macro preprocessor from eliminating comments.
−o output
Passed on to ld, to name the final output file output. If this option is used the file a.out will be left undisturbed.
−lxx Passed on to ld, to load the library libxx.a from /lib or /usr/lib into the executable file; the most useful is ‘-lm’ for the mathematical library.
−Dname=def
−Dname Define the name to the preprocessor, as if by ‘#define’. If no definition is given, the name is defined as "1".
−Uname Remove any initial definition of name. The −D option and the −U option have equal precedences. That is, if the same name is used in both a −D option and a −U option, the name will be defined or undefined according to the last occurrence of the name in the list.
−Idir ‘#include’ files whose names do not begin with ‘/’ are always sought first in the directory of the file argument, then in directories named in −I options, then in directories on a standard list.
−bstring Find a substitute assembler and a substitute link editor in the files named string with the suffixes as and ld, respectively. If string is empty, use a standard backup version.
−Bstring Find substitute compiler passes in the files named string with the suffixes cpp, ccom and c2. Use string as the search path for the startup routine, as well. If string is empty, use a standard backup version.
−t[p02alc]
Find only the designated compiler passes in the files whose names are constructed by a −b and/or a −B option. The letters indicate preprocessor, compiler proper, optimizer, assembler, link editor, and startup routine, respectively. In the absence of a −b or a −B option, the string is taken to be /lib/n.
−Wc,arg1[,arg2...]
Hand off the argument[s] argi to pass c where c is one of [p02al] indicating preprocessor, compiler proper, optimizer, assembler, and link editor, respectively.
−X Do not look in alternate search paths for include files or compilation processors. An error message will be generated if the file(s) cannot be located in the specified search path(s).
Other arguments are taken to be either loader option arguments, or C-compatible object programs, typically produced by an earlier cc run, or perhaps libraries of C-compatible routines. These programs, together with the results of any compilations specified, are loaded (in the order given) to produce an executable program with name a.out.
FILES
file.cinput file
file.oobject file
a.outloaded output
/tmp/cct?temporary
/lib/cpppreprocessor
/lib/ccomcompiler
/lib/c2optional optimizer
/lib/crt0.oruntime startoff
/lib/mcrt0.ostartoff for profiling with prof(1)
/lib/gcrt0.ostartoff for profiling with gprof(1)
/lib/libc.astandard library
/lib/libp/libc.aprofiling library
/usr/includestandard directory for ‘#include’ files
mon.outfile produced for analysis by prof(1)
gmon.outfile produced for analysis by gprof(1)
SEE ALSO
CX/UX Programmer’s Guide.
adb(1), as(1), dbx(1), gprof(1), hc(1), ld(1), monitor(3C), prof(1)
DIAGNOSTICS
The diagnostics produced by C itself are intended to be self-explanatory. Occasional messages may be produced by the assembler or the link editor.
BUGS
The compiler currently ignores advice to put char, unsigned char, short or unsigned short variables in registers.
CX/UX User’s Reference Manual