Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ vcc(1) — Ultrix/UWS 4.2 VAX

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

adb(1)

as(1)

dbx(1)

gprof(1)

ld(1)

lk(1)

prof(1)

monitor(3)

vcc(1)  —  VAX

Name

vcc − VAX C compiler

Syntax

vcc [option...] file... 

Description

The vcc command invokes the VAX C compiler for ULTRIX and accepts the following types of arguments:

•Arguments whose names end with .c.  These arguments are treated as C source programs. The source code is compiled and the resulting object code is left in a file whose name is the same as the source except with a .o file extension.  If you choose to compile and load a single program in one step, the vcc command program deletes the intermediate object code file.

•Arguments whose names end with .s.  These arguments are treated as assembly source programs and are passed to the assembler, which creates an output file with a .o extension. 

•Arguments whose names end in something other than .c or .s.  These arguments are treated as either compiler or linker option arguments or C-compatible object programs that were produced during an earlier vcc compilation or were extracted from the libraries of C-compatible routines.

Options

The VAX C compiler for ULTRIX can produce two types of object files: the standard BSD .o format used by ld(,), or an object format that can be read only by lk(.). The object file format, and the linker used is controlled by the −V lkobject option. By default, the compiler produces standard BSD .o format. 

The following options are accepted by the vcc command.  See lk() or ld() for load-time options.

−b Does not pass the −lc library to the linker by default. 

−Bstring Finds substitute compiler, preprocessor, assembler, and linker in the files named by string. If string is empty, uses a standard backup version. 

−c Suppresses the loading phase of the compilation and forces an object file to be produced even if only one program is compiled. 

−Dname=def

−Dname Defines name to the preprocessor. This functions as if an additional #define preprocessor directive were embedded in the source code.  If no definition is given, the name is defined as 1. 

−E Runs only the macro preprocessor on the named C programs and sends the result to the standard output. 

−Em Runs only the macro preprocessor on the named C programs and produces the makefile dependencies. 

−f Uses single-precision rather than double-precision floating point representation.  Procedure arguments are still promoted to double-precision floating point format.  Programs with a large number of single-precision computations run faster with this option. However, a slight loss in precision may result since intermediate results are saved using a single-precision representation rather than the default double-precision representation. 

−g Generates additional symbol table information for dbx(.). This also passes the −lg flag to the linker. 

−Idir Seeks #include files whose names do not begin with a directory specification in the following directories: first, in the directory of the file argument; second, in directories named in −I options; finally, in directories in a standard list. 

−lx Uses the specified library.  This option lists an abbreviation for the library name /lib/libx.a, where x is a string.  If the library is not found, the linker tries /usr/lib/libx.a. If that does not exist, the linker tries /usr/local/lib/libx.a. A search for a library starts when the library name is encountered, so the placement of a −l within the compilation or the linker command line is significant. 

−Md Specifies DFLOAT (the default) double-precision floating point type and passes the −lc flag to the linker. 

−Mg Specifies GFLOAT double precision floating point type and passes the −lcg flag to the linker.  This option uses the GFLOAT version of libc.  If the math library is used with code compiled with the −Mg flag, the GFLOAT version is linked by specifying −lmg to the vcc or the linker command.

−o output Names the final output file output.  If this option is used, the file a.out is left undisturbed.  If the named file has a .o or .a file extension, the following error message is displayed: −o would overwrite. 

−O Invokes the object-code improver. This option is on by default and has no effect. 

−p Produces code that counts the number of times each routine is called.  If loading takes place, it replaces the standard startup routine with one that initially calls monitor and writes out a mon.out file upon normal termination of program execution.  The prof command is then used to generate an execution profile.

−pg Produces counting code similar to that generated by −p, but invokes a run-time recording mechanism that keeps more extensive statistics and produces a gmon.out file upon normal termination.  In addition, a profiling library is searched instead of the standard C library.  The gprof command is then used to generate an execution profile.

−t [p0al] Finds only the designated preprocessor, compiler, assembler, and linker in the files whose names are constructed by a −B option. 

−Uname Removes any initial definition of name. 

−v file Produces a listing in file, complete with cross-reference and machine code listing sections. 

−V arg Compiles the source code using vendor specific options. The available options are described in detail in the Guide to VAX C for ULTRIX. 

The following is a list of the available options:

cross_referenceGenerates a cross reference listing section

debugGenerates a loadable module for use with dbx

defineAssigns a specified value to a name

g_floatUses the G_floating point type

listGenerates a list file

lkobjectGenerates object files in lk format, instead of BSD .o format and uses the lk linker

machine_codeGenerates the machine code listing section

objectGenerates an object file with a specific name

optimizeSelects code optimization

showIncludes symbol and intermediate expansions

standardSelects portability mode

undefineRevokes the assignment of a value to a name

warningsDisables warning or informational messages

−w Suppresses warning diagnostics. 

−Y[option] Compiles a file for one of the following options:

SYSTEM_FIVE
BSD
POSIX

If no −Y option is specified, vcc searches for the PROG_ENV variable to be defined. If PROG_ENV is set to SYSTEM_FIVE or POSIX, the effect is the same as −YSYSTEM_FIVE or −YPOSIX.  If PROG_ENV is not set to either SYSTEM_FIVE or POSIX, the effect is the same as −YBSD. 

If no option is specified with −Y, the default is −YSYSTEM_FIVE.  If an option other than SYSTEM_FIVE, BSD, or POSIX is specified, a warning message is printed and −Y is ignored.  If there are multiple −Y options, only the last one takes effect. 

If −YSYSTEM_FIVE is explicitly specified, the −YSYSTEM_FIVE parameter is added to the linker call.  In addition, the following occurs:

•−DSYSTEM_FIVE is added to the vaxc command (or cpp command if −E is specified). 

•The linker parameters −lc, −lcg, or −lc_p are preceded with −lcV, −lcVg, or −lcV_p (if not suppressed by −b). 

•The linker parameters −lm, −lmg, or −lmp are changed to −lmV, −lmVg, or −lmV_p (if present). 

If −YBSD is specified, then the parameter −YBSD is added to the lk call.

If −YPOSIX is specified, then the parameter −DPOSIX is added to the vaxc call. Also, the parameter −YPOSIX is added to the linker call. 

If −Y does not exist and PROG_ENV is not defined, the default is −YSYSTEM_FIVE. 

Default Symbols And Macros

The VAX C compiler recognizes the following predefined symbols. The symbols are all assigned the value one (1). You can use these symbols to separate portable and nonportable code within your VAX C programs:

vaxcVAXC
vax11cVAX11
vaxVAX

In addition to the VAX symbols definitions, listed above, the VAX C compiler for ULTRIX provides the following default symbols:

unixAny UNIX system
bsd4_2Berkeley UNIX Version 4.2
ultrixULTRIX only
vaxVAX processor only

The VAX C compiler recognizes the following predefined macros:

__DATE__Evaluates to a string, specifying the compilation date
__FILE__Evaluates to a string, specifying the current source file
__LINE__Evaluates to an integer, specifying the line containing the
macro reference.
__TIME__Evaluates to a string, specifying the compilation time

Restrictions

The compiler treats the register keyword as a suggestion, attaching the register keyword to a variable declaration does not guarantee that the variable will be allocated to a register. 

If the −Mg flag is used to produce GFLOAT code, it must be used when compiling all of the modules to be linked.  Use the −Mg flag if you use the vcc command to invoke the linker indirectly to link the modules.  If you invoke the linker directly, use the −lcg flag rather than −lc flag.  If the math library is used, specify the −lmg flag rather than the −lm flag in order to use the GFLOAT version. 

The compiler and the linker, cannot detect the use of mixed double floating point types.  If you use them, your program’s results may be erroneous. 

Diagnostics

The diagnostics produced by VAX C are self-explanatory.  Occasional messages are produced by the assembler or loader. 

Files

file.cinput file
file.oobject file
a.outloaded output
/usr/bin/vcccommand program
/lib/cpppreprocessor
/usr/lib/cerrfileerror message file
/usr/lib/vaxccompiler
/lib/crt0.oruntime startoff
/lib/mcrt0.ostartoff for profiling
/usr/lib/gcrt0.ostartoff for gprof-profiling
/lib/libc.astandard library
/usr/libcg.aGFLOAT version of the standard library
/usr/lib/libc_p.aprofiling library
/usr/includestandard directory for #include files
/usr/man/man1/vcc.1 manual page
mon.outfile produced for analysis by prof(1)
gmon.outfile produced for analysis by gprof(1)

See Also

adb(1), as(1), dbx(1), gprof(1), ld(1), lk(1), prof(1), monitor(3)
Guide to VAX C for ULTRIX

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026