DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

mcc(CP)


mcc -- a backward compatible frontend to cc

Syntax

mcc [option]... file...

Description

mcc(CP) is a backward compatible frontend to cc(CP). By default, mcc turns on the -Xm option of cc and recognizes most of the common options of the C compiler in the previous release of SCO OpenServer Development System. It examines the options and filename suffixes of its file arguments, and then executes the proper compiler passes with appropriate options and arguments. The default filename of the resulting executable is a.out, which can be changed using option -o. If an old unsupported cc option is passed to mcc, it causes a compiler error and an error message is printed. The error message states explicitly that the option is not supported. This frontend is provided for backward compatibility reasons and may not be supported in future releases.

The filename suffixes recognized by mcc and the associated applicable compilation phases are:


.c
A file that contains unprocessed C source; all phases are applicable.

.i
A file that contains preprocessed C source; all phases except for preprocessing are applicable.

.s
A file that contains assembly language source; only the assembling and linking phases are applicable.

.a, .o, .so
A file that contains input applicable only to the linking phase. This category commonly includes object files (.o), archive libraries (.a), and shared object libraries (.so).

By default, mcc invokes /usr/ccs/bin/cc as the C compiler driver. This default path can be overridden by setting the environment variable USLCC to be the path of an alternate binary.

Special characters that are normally interpreted by the shell are preserved when mcc parses its command line options.

Option -verbose and options in the group -Y[p02balSIP] are recognized by mcc but not by previous version of cc.

Supported options

The following options are supported:

-ansi
Enforce strict adherence to the ANSI specifications for the C language.

-c
Suppress the linking stage and do not create an executable file. Object files (.o files), if produced, are not removed.

-C
In the preprocessed source, retain all comments unless they are on the same lines as preprocessing directives. These preserved comments can be used by lint(CP) later. The default is to remove all comments when preprocessing a file. This option may only be used together with -E or -P (see below).

-CSON
Turn on optimization.

-CSOFF
Turn off optimization.

-d
Print out each command and its options and the argument before the invoked command is executed by mcc.

-D name[=string]
Define name to be a macro and replace this macro by the value of string. If the optional =string part is not given, the macro is replaced by 1. The effect of using this option is the same as if name is defined through a #define directive in the source file following this option. See the -a and -b options in the cc(CP) man page for more information on the default manifest defines. The -D option can be used several times on the command line, but it must not define the same name twice.

-E
Suppress all phases but preprocessing, and send the result to the standard output. The result will contain lines similar to preprocessing directives and can be used for a subsequent compiling phase.

-Foobject-filename
Rename the generated object file as object-filename instead of using the default name, file.o.

-Fe filename
Rename the executable file as filename.

-g
Include debugging information in the output file. If -O is also specified, -g takes precedence.

-iBCS2
Enforce strict Intel Binary Compatibility Standard 2 conformance.

-I directory
Search an include file in directory before searching the standard list of directories, if an absolute pathname is not used for the include file. If the -I option is used multiple times, these additional directories are first searched for included files in the order specified by -I.

-J
Make the data type char to be unsigned by default.

-lname
Search library libname.a for unresolved function references.

-link
All options and filenames that follow -link (and any options not recognized by the compiler) are passed directly to ld. No other compiler option can appear after the -link option.

-o filename
Use filename as the name of the executable file instead of using the default name a.out.

-Od
Turn off optimization.

-O
Turn on optimization. If the option -g or -ql is also specified, optimization is turned off.


CAUTION: The following -O option arguments have no special effect. They all simply turn on optimization:

a c e f g h i l m n p r s t x z

To fine tune optimization, use cc(CP) with option -O or -K and their respective option arguments.



-p
Generate and store extra codes into the executable program for program profiling. When the executable program is run, the profiling information is saved into the file mon.out, which can be later examined using prof(CP).

-pack
Pack structures. Each structure member is stored at the first available byte, without regard to int boundaries. Although this will save space, execution will be slower because of the extra time required to access 16-bit members that begin on odd boundaries.

-posix
Enforce strict POSIX conformance. The language is restricted to ANSI specifications. When using this option, you need to link in the math library (with -lm), because, unlike in the previous release, the math routines are not automatically linked in. Do not use the -ansi, -xpg4 or -xpg3 flags with this flag.

-P
Preprocess only each source file. The result is placed in .i-suffixed file. Unlike -E, the result will contain no #line directives. Compiling this resultant .i file produces an executable whose line numbers match the .i file instead of the .c file.

-ql
Provide line profiling, that is, ``coverage'' and ``count'' statistics for each line of the program. The output from line profiling can be examined with lprof(CP).

-qp
This flag is equivalent to -p.

-r
Perform an incremental link.

-s
Instruct the linker to strip symbol table information from the executable output file.

-strict
Restrict the language to ANSI specifications.

-svid
Enforce SVID Issue 2 conformance.

-S
Create an assembler file for each source file. The resulting assembler file has the same basename as the source file and has the suffix .s.


NOTE: The suffix is .s, not .asm. This is a change from previous behavior.


-u
Eliminate all manifest defines.

-Udefinition
Undefine definition as if by a #undef directive, even if definition is a predefined macro (including those that begin with __) or is also the subject of a -D option. This option is passed to the preprocessor.

-verbose
Generate verbose output, showing how other mcc options are converted to equivalent cc options. See also INFOCC in ``Environment variables.''

-W tool,list
Pass the comma-separated list of arguments list (in order) to the single compilation pass named by tool. To include a comma in an argument in list, precede the comma by a \ character. This option is passed to cc unchanged. See the man page cc(CP) for further details.

-W level
Set the compiler warning message level. level is a digit 0 through 3, letter x or X. This option does not affect the text of compiler error messages.

0
Do not issue any warning messages.

1
Issue most warning messages (the default level).

2
Issue even more warning messages, including some warnings about behavioral changes from K&R C (see -Xk) to ANSI C.

3
Issue all of the above warning messages, and more. Use -w2 or -w3 when initially porting K&R code to an ANSI environment. See ``C compiler diagnostics'' in the Programming Tools Guide for more details.

x, X
Cause all compiler warnings to be fatal. This can be combined with -w0, -w1, -w2, or -w3.

-xpg3, -xpg4
Enforce strict XPG4 conformance. The language is restricted to ANSI specifications. When using this option, you need to link in the math library (with -lm), because, unlike in the previous release, the math routines are not automatically linked in. Do not use the -ansi or -posix flags with this flag.

-xpg3plus, -xpg4plus
Closely represent a true X/Open conforming implementation with SCO OpenServer added value. Some of the added value is non-conforming since it pollutes the user's name space.

-X
Do not search the standard directories for the included files.

-Y pass,dir
Find the item(s) named by pass in the directory dir. The option argument pass is one or more of the following:

p
preprocessor

0
compiler

2
optimizer

b
basic block profiler

a
assembler

l
linker

If more than one conceptual phase is implemented by a single tool and differing directories are specified for the phases, it is unspecified which directory is used. In addition, any one of the following can also be used as the option argument pass:


I
Change the directory searched last to dir for preprocessing phase include files.

L
Change the linking phase default library search path to dir.

P
Change the linking phase default library search path to be the colon-separated list of one or more directories, dir. More directories can be added to the front of the path due to other options. This option is incompatible with -YU and -YL and will cause an error if it is used with either one of them.

S
Changes the directory to dir in which to find the start-up object files(crt files).

U
Change the linking phase library search path LIBDIR to dir.

-z
Print out each command with its options and arguments as invoked by mcc but do not execute these commands.

-Za
Enforce strict adherence to the ANSI specifications for the C language.

-Zd, -Zi
Include information for the screen-oriented debuggers dbxtra and dbXtra and the symbolic debugger (sdb) in the output file. This option is equivalent to the -g option.

-Zpn
Pack structure members in memory. The argument n can only be one of the following:

1
Allocate alignment to 1

2
Allocate alignment to 2

4
Allocate alignment to 4 (default)

Ignored options

Not all options accepted by the previous version of cc are supported by mcc. Some of these options are silently ignored and do not cause an error. The following options are in this group and are ignored:

-Fnum -Gs -i -K -LARGE
-M[3es] -n -quiet -unix  

                   -Fnum     -Gs   -i       -K      -LARGE
                   -M[3es]   -n    -quiet   -unix

Unsupported options

Options in this group are supported by the previous version of cc and still recognized by mcc. However, they will cause a fatal compiler error if any of them are passed to mcc. This group includes the following options:

-Barg -compat -dos -EP -FP
-F[aclms] -Gc -H -help -L
-m -Marg[+] -nl -N[DMT] -os2
-S[lps] -Tc -V -x2.3 -xenix
-xout -Z[egls]      

                -Barg       -compat    -dos   -EP       -FP
                -F[aclms]   -Gc        -H     -help     -L
                -m          -Marg      -nl    -N[DMT]   -os2
                -S[lps]     -Tc        -V     -x2.3     -xenix
                -xout       -Z[egls]

+ excluding the option arguments listed in ``Ignored options''

Environment variables

In addition to the shell environment variables that are supported by cc(CP), mcc also supports the following two environment variables:


INFOCC
When this environment variable is set to any non-empty string, mcc prints various information messages about how old options are converted by mcc to the equivalent options that are supported by cc. Its use is recommended when you port old Makefiles and the like for use with this C compiler.

USLCC
Invokes an alternate binary, USLCC, as the C compiler driver. If this environment variable is not set, mcc invokes /usr/ccs/bin/cc.

Exit value

Upon successful completion, the exit status of mcc is 0, otherwise the exit status is non-zero.

Files


/usr/ccs/bin/mcc
a shell driver, which invokes /usr/ccs/bin/cc and enables some extensions provided in the previous release of cc(CP)

/usr/ccs/obin/cc
a link to /usr/ccs/bin/mcc

See also

ar(CP), cc(CP), lint(CP), lprof(CP), nm(CP), strip(CP)
© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003