wcc, wcc386, wpp, wpp386

C/C++ compiler command (WATCOM)

Syntax:

wcc [options] file_spec [options] [@extra_opts]
wpp [options] file_spec [options] [@extra_opts]
wcc386 [options] file_spec [options] [@extra_opts]
wpp386 [options] file_spec [options] [@extra_opts]

Options:

-0
(wcc/wpp only) use 8088 and 8086 instructions
-1
(wcc/wpp only) use 188 and 186 instructions
-2
(wcc/wpp only) use 286 instructions
-3
(wcc/wpp only) use 386 instructions
-4
(wcc/wpp only) use 486 instructions
-5
(wcc/wpp only) use Pentium instructions
-3r
(wcc386/wpp386 only) generate 386 instructions based on 386 instruction timings, and use register-based argument passing conventions
-3s
(wcc386/wpp386 only) generate 386 instructions based on 386 instruction timings, and use stack-based argument passing conventions
-4r
(wcc386/wpp386 only) generate 386 instructions based on 486 instruction timings, and use register-based argument passing conventions
-4s
(wcc386/wpp386 only) generate 386 instructions based on 486 instruction timings, and use stack-based argument passing conventions
-5r
(wcc386/wpp386 only) generate 386 instructions based on Intel Pentium instruction timings, and use register-based argument passing conventions (default)
-5s
(wcc386/wpp386 only) generate 386 instructions based on Intel Pentium instruction timings, and use stack-based argument passing conventions
-7
generate in-line 80x87 instructions (equivalent to the -fpi87 option below)
-b{d,m,w}
build Dynamic link, Multi-thread, or default Windowing application, respectively
-bt[=os]
build target for the os operating system
-d1{+}
include line number debugging information (C only: -d1+ includes typing information for global symbols and local structures and arrays)
-d2
include full symbolic debugging information
-d3
include full symbolic debugging information with unreferenced type names
-dname[=text]
preprocessor #define name [text]
-d+
allow extended -d macro definitions
-db
generate browsing information
-enumber
set the limit on the number of errors (the default is 20)
-ee
call an epilogue hook routine
-ei
force enums to be of type int
-en
emit the routine name before the prologue
-ep[number]
call a prologue hook routine, allocating number stack bytes
-et
generate code for Pentium profiling
-ew
(C++ only) generate less verbose messages
-ez
(wcc386/wpp386 only) generate a Phar Lap Easy OMF-386 object file
-fh[q][=file_name]
use precompiled headers
-fi=file_name
force file_name to be included
-fo=file_name
set the name of the object or preprocessor output file
-fp2
generate in-line 80x87 instructions
-fp3
generate in-line 387 instructions
-fp5
generate in-line 80x87 instructions optimized for the Pentium processor
-fpc
generate calls to a floating-point emulation library
-fpd
enable generation of code that checks for the Pentium FDIV bug
-fpi
(wcc/wpp only) generate in-line 80x87 instructions with emulation (default)

(wcc386/wpp386 only) generate in-line 387 instructions with emulation (default)

-fpi87
(wcc/wpp only) generate in-line 80x87 instructions

(wcc386/wpp386 only) generate in-line 387 instructions

-fpr
generate 8087 code compatible with older versions of compiler
-fr=file_name
specify the name of the error file
-ft
(C++ only) try truncated (8.3) header file specification
-fx
(C++ only) don't try truncated (8.3) header file specification
-g=codegroup
set the code group name
-h{w,d,c}
set the debug output format (WATCOM, Dwarf, Codeview)
-i=directory
add directory to the list of include directories
-j
change char default from unsigned to signed
-m{f,s,m,c,l,h}
specify the memory model (flat, small, medium, compact, large, huge). The default is -ms for 16-bit, -mf for 32-bit.
-nc=name
set the name of the code class
-nd=name
set the name of the data segment
-nm=name
set the module name to be different from the filename
-nt=name
set the name of the text segment
-o{a,c,d,e,f,f+,i,l,l+,m,n,o,p,r,s,t,u,x}
control optimization
-p{e,l,c,w=num}
preprocess file only, sending output to standard output:
c
include comments
e
encrypt identifiers (C++ only)
l
include #line directives
w=num
wrap output lines at num columns (zero means no wrapping)
-r
save/restore segment registers
-ri
return chars and shorts as ints
-s
remove stack overflow checks
-sg
generate calls to grow the stack
-st
touch stack through SS first
-t=num
set the tab stop multiplier
-uname
preprocessor #undef name
-v
output function declarations to .def file (with typedef names)
-wnumber
set the warning level number (the default is -w1)
-wcd=number
disable the compiler message with the given number
-wce=number
enable the compiler message with the given number
-we
treat all warnings as errors
-wo
(16-bit only, C only) warn about problems with overlaid code
-wx
set the warning level to the maximum setting
-xd
(C++ only) disable exception handling (default)
-xdt
(C++ only) disable exception handling (same as -xd)
-xds
(C++ only) disable exception handling (table-driven destructors)
-xs
(C++ only) enable exception handling
-xst
(C++ only) enable exception handling (direct calls for destruction)
-xss
(C++ only) enable exception handling (table-driven destructors)
-za
disable language extensions (enabled by default). Enable language extensions with the -ze option.
-zc
place literal strings in the code segment
-zd{f,p}
allow DS register to float, or peg it to DGROUP (the default is -zdp)
-zdl
(wcc386/wpp386 only) load DS register directly from DGROUP
-ze
enable language extensions (the default setting). Disable language extensions with the -za option.
-zf{f,p}
allow the FS register to be used (the default for all but the flat memory model) or not be used (the default for the flat memory model)
-zg
output function declarations to .def (without typedef names)
-zg{f,p}
allow GS register to be used or not used, respectively
-zk0
double-byte char support for Kanji
-zk0u
translate Kanji double-byte characters to UNICODE
-zk1
double-byte char support for Chinese/Taiwanese
-zk2
double-byte char support for Korean
-zku=codepage
load the UNICODE translation table for the specified code page
-zl
suppress the generation of library file names and references in the object file
-zld
suppress the generation of file-dependency information in the object file
-zm
generate individual functions into separate segments
-zo
(C++ only) use exception-handling for a specific operating system
-zp[{1,2,4,8}]
set minimal structure packing (member alignment) (default is -zp1)
-zq
operate quietly
-zs
syntax check only
-ztnumber
set the data threshold (the default is -zt32767)
-zu
don't assume that SS contains the segment of DGROUP
-zv
make sizeof (void) == 1, so you can directly increment or decrement void pointers without having to do type-casting
-zw
Microsoft Windows prologue/epilogue code sequences
-zW
(wcc/wpp only) Microsoft Windows optimized prologue/epilogue code sequences
-zWs
(wcc/wpp only) Microsoft Windows smart callback sequences
-zz
remove @size from __stdcall function names (10.0-compatible)

Description:

wcc
is the 16-bit Watcom C compiler.
wpp
is the 16-bit Watcom C++ compiler.
wcc386
is the 32-bit Watcom C compiler.
wpp386
is the 32-bit Watcom C++ compiler.
file_spec
is the QNX name specification of the file to be compiled. The Watcom C and C++ compilers assume default file extensions when no extension is specified:
  • Watcom C assumes an extension of .c
  • Watcom C++ checks for a file with one of the following extensions, in the order listed:
    • .C
    • .cpp
    • .cc
    • .c

If a path isn't specified, the current working directory is assumed. If the file isn't in the current directory, an adjacent C directory (that is,../c) is searched.

extra_opts
is the name of an environment variable or file that contains additional command line options to be processed. If the specified environment variable doesn't exist, a search is made for a file with the specified name.

If no file extension is included in the specified name, the default file extension is .occ. A search of the current directory is made. If not successful, an adjacent OCC directory (that is, ../occ) is searched, if it exists.

Environment variables:

You can use an environment variable to specify commonly used compiler options, as follows:

CommandEnvironment Variable
wccWCC
wppWPP
wcc386WCC386
wpp386WPP386

These options are processed before options specified on the command line.

See also:

cc, and the following in the Compiler & Tools User's Guide: