• Keine Ergebnisse gefunden

Compiler options reference

Im Dokument or an (Seite 59-70)

46

Table 3.1 lists c~mpiler options for the IDE and the command line. Most IDE options appear in the Project Options dialog box; if an option doesn't appear in the Project Options dialog box, the IDE equivalent option or command appears in angle brackets <>. Some topic names are abbreviated or repeated in this table. You can find a more detailed explanation for each option on the pages referenced in the table.

Default options for both 16- and 32-bit command-line compilers are marked by a bullet (.); otherWise, the bullet is marked for 16-bit only default (.16) or 32-bit only default(.32). Note that defaults in the IDE are different. The main default difference is that the IDE compiles with debug and browser information, making your compiled files larger than if you compiled with the command-line compilers (the applications will be the same size if you use the same set of options for both IDE and command-line).

Borland C++ Users Guide

Table 3.1: Options summary

Option Page IDE setting Description

@fiIename 45 <use project file name> Read compiler options from the response file filename.

+fiIename 45 <none> Use the alternate configuration

file filename.

-1 79 <none> Generate 80186 instructions.

.16 -2 61 16-bit CompileriProcessorl80286 Generate 80286

protected-mode compatible instructions (16-bit only).

-3 61 16-bit CompileriProcessorl80386 Generate 16-bit 80386

protec-ted-mode compatible instructions (BCC option).

.32 -3 68 32-bit CompileriProcessorl80386 Generate 32-bit 80386

protec-ted-mode compatible instructions (BCC32 option).

-4 61 16-bit CompileriProcessorli486 Generate 16-bit 80486

protec-ted-mode compatible instructions (BCC option).

-4 68 32-bit CompileriProcessorli486 Generate 32-bit 80486

protec-ted-mode compatible instructions (BCC32 option).

-5 68 32-bit CompilerlProcessorlPentium Generate 32-bit Pentium

protected-mode compatible instructions.

-A 59 CompilerlSourcelANSI ANSI language compliance.

-A-, -AT 59 CompilerlSourcelBorland extensions Borland C++ language compliance.

-AK 60 CompilerlSourcelKernighan and Ritchie Kernighan and Ritchie

language compliance.

-AU 60 CompilerlSourcelUNIX V UNIX V language compliance.

-an' 68 16- or 32-bit CompilerlProcessorlByte, Word, Double Word Align to n: 1 = Byte, 2 = Word, 4 = Double Word (32-bit only).

-a- 62 16-bit CompilerlProcessorlByte Align to one byte.

-B 79 <none> Compile and call the

I assembler to process assembly code.

-b 57 CompilerlCode GenerationlAllocate enums and ints Make enums always integer-sized.

-b- 57 CompilerlCode GenerationlAllocate enums and ints (uncheck) Make enums byte-sized when possible.

-C 59 CompilerlSourcelNested Comments Turn nested comments on.

-C- 59 CompilerlSourcelNested Comments (uncheck) Turn nested comments off.

-c 79 <ProjectICompile> Compile to .OBJ but don't link.

-Dname 57 CompilerlDefines Define name to the null string.

. -Dname=string 57 Compilerl Defines Define name to string.

-d 57 CompilerlCode GenerationlDuplicate strings merged Merge duplicate strings.

-d- 57 CompilerlCode GenerationlDuplicate strings merged (uncheck) Don't merge duplicate strings.

Table 3.1: Options summary (continued)

Option Page IDE setting Description

-dc 64 16-bit CompilerlMemory ModeliPut strings in code segments Move string literals from data segment to code segment (16-bit only).

-efilename 79 <Edit node attributes in project manager> Link to produce filename.

-Efilename 80 <none> Use filename as the

assembler.

-Fc 59 -CompilerlCompiler OutputiGenerate COMDEFs Generate COMDEFs (16-bit C only).

-Ff 64 16-bit Compil~rlMemory ModeliAutomatic far data Create far variables automatically (16-bit only).

-Ff=size 64 16-bit CompilerlMemory ModeliFar Data Threshold Create far variables

automatically; set the threshold to size (16-bit only).

-Fm 80 <none> Enable the -Fe, -Ff, and -Fs

options (16-bit only).

-Fs 80 < TargetExpertlAlternate startup> Assume OS

=

SS in all

memory models (16-bit DOS only).

-f 58 CompilerlFloating pointlNo floating point (uncheck) Allow floating point.

-f- 58 CompilerlFloating pointlNo floating point Don't do floating point.

off 58 CompilerlFloating pointiFast floating point Fast floating point.

-ft- 58 CompilerlFloating pointlFast floating point (uncheck) Strict ANSI floating point.

-f87 80 <none> Use 8087 hardware

instructions.

-f287 80 <TargetExpert and click Fast floating point> Use 80287 hardware instructions (for DOS applications).

-G 72 OptimizationslSpecificlExecutable Speed Select code for speed.

-G- 72 OptimizationslSpecificlExecutable Size Select code for size.

-gn 77 MessageslStop after n warnings Warnings: stop after n

messages (100 by default).

-H 61 CompilerlPrecompiled headerslGenerate and use Generate and use precompiled headers.

-H- 61 CompilerlPrecompiled headerslDo not generate or use Do not generate or use precompiled headers.

-Hc 80 <none> Cache precompiled headers.

Must be used with -H or -Hxxx.

-Hu 61 CompilerlPrecompiled headerslUse but don't generate Use but don't generate precompiled headers.

-H"xxx" 61 CompilerlPrecompiled headerslStop precompiling after header Stop compiling precompiled headers at file "xxi' (32-bit only). This must be used with -H, -Hu, or -H=fiIename.

-H=filename 61 CompilerlPrecompiled headerslPrecompiled header file name Set the name of the file for precompiled headers.

48 Borland C++ Users Guide

Table 3.1: Options summary (continued)

Option Page IDE setting Description

-h 64 16-bit CompilerlMemory ModeliFast huge pointers Use fast huge pointer arithmetic (16-bit only).

-Ipath 55 Directoriesllnclude Set search path for directories

for include files.

-in 59 CompilerlSourcelldentifier length Make significant identifier

length to be n (the default is

-Jg 71 C++ OptionslTemplateslSmart

32).

Generate definitions for all template instances and merge duplicates.

-Jgd 71 C++ OptionslTemplateslGlobal Generate public definitions for

all template instances;

duplicate result in redefinition errors.

-Jgx 71 C++ OptionslTemplateslExternal Generate external references

for all template instances.

-jn 77 MessageslStop after n errors Errors: ,stop after n messages

(25 messages by default).

-K 57 CompilerlCode GenerationlUnsigned characters Default character type

-K- 57 CompilerlCode GenerationlUnsigned characters (uncheck)

unsigned.

Default character type ~igned.

-K2 69 C++ OptionslC++ CompatibilitylDon't treat char as distinct Allow only two character types (unsigned and signed); char is treated as signed (16-bit only). Compatibility with Borland C++ 3.1 and earlier.

-k 60 CompilerlDebugginglStandard stack frame Turn on standard stack frame.

-Lpath 55 DirectorieslLibrary Set search path for library files.

-Ix 80 <set Linker options> Pass option xto the linker (can

use more than one x).

-I-x 80 <set Linker options> Disable option x for the linker.

-M 80 <check LinkerlMap FilelSegment, Public, or Detailed> Instruct the linker to create a map file.

-mc 63 16-bit CompilerlMemory ModeliCompact Compile using compact

memory model (16-bit only).

-mh 63 16-bit CompilerlMemory ModeliHuge Compile using huge memory

model (16-bit only).

-ml 63 16-bit CompilerlMemory ModellLarge Compile using large memory

model (16-bit only).

-mm 63 16-bit CompilerlMemory ModeliMedium Compile using medium

memory model (16-bit only).

-mm! 63 16-bit CompilerlMemory ModeliMedium and Never Compile using medium memory model; assume OS !=

SS (16-bit only).

oms 63 16-bit CompilerlMemory ModeliSmali Compile using small memory

model (16-bit only).

Table 3.1: Options summary (continued)

Option Page IDE setting Description

oms! 63 16-bit CompilerlMemory ModeliSmall and Never Compile using small memory model; assume DS != SS (16-bit only).

-mt 63 16-bit CompilerlMemory ModeliTiny Compile using tiny memory

model (16-bit only).

-mt! 63 16-bit CompilerlMemory ModellTiny and Never Compile using tiny memory model; assume DS.!= SS (16-bit only).

-N 60 CompilerlDebugginglTest stack overflow Check for stack overflow.

-npath 55 DirectorieslFinal Set the output directory.

-0 73 OptimizationslSizelJump optimizations Optimize jumps.

-01 72 OptimizationslSpecificlExecutable size Generate smallest possible code.

-02 72 OptimizationslSpecifici Executable speed Generate fastest possible code (same as -Ox).

-Oa 72 OptimizationslSpecificiAssume no pointer aliasing Optimize assuming pointer expressions aren't aliased on common subexpression evaluation.

-Ob 74 OptimizationslSizelDead code elimination Eliminate dead code.

-Oc 72 OptimizationslSpecificlOptimize locally Eliminate duplicate expressions within basic blocks.

-Od 72 OptimizationslDisable all optimizations Disable all optimizations.

-Oe 74 OptimizationslSizelGlobal register allocation Allocate global registers and analyze variable live ranges.

-Og 72 OptimizationslSpecificiOptimize globally Eliminate duplicate expressions within functions.

-Oi 74 OptimizationslSpeedlinline intrinsic functions Expand common intrinsic functions inline.

-01 73 OptimizationslSizelLoop optimization Compact loops.

-Om 75 OptimizationslSpeedlinvariant code motion Move invariant code out of loops.

-Op 76 OptimizationslSpeedlCopy propagation Propagate copies.

-Os 72 OptimizationslSpecificlExecutable size Generate smallest possible code.

-Ot 72 OptimizationslSpecificlExecutable speed Generate fastest possible code (same as -Ox).

-Ov 76 OptimizationslSpeedlinduction variables Enable loop induction variable and strength reduction.

-OW 74 OptimizationslSizelWindows prolog/epilog Suppress the inc bp/dec bp on Windows far functions (16-bit only).

-Ox 72 Optimizationsl Specificl Executable speed Generate fastest code;

Microsoft compatible.

50 Borland C++ Users Guide

Table 3.1: Options summary (continued)

Option Page ' IDE setting Description

-ofilename 81 <none> Compile source file to

filename.OBJ.

-P 81 <use Tools> Perform a C++ compile

regardless of source file extension.

-Pext 81 <use Tools> Perform a C++ compile and

set the default extension to ext.

-P- 81 <use Tools> Perform a C++ or C compile

depending on source file extension.

-P-ext 81 <use Tools> Perform a C++ or C compile

depending on extension; set default extension to ext.

-p 62 16-bit CompilerlCalling ConventionlPascal Use Pascal calling convention with 16-bit applications (BCC option).

-p 68 32-bit CompilerlCalling ConventionlPascal Use Pascal calling convention with 32-bit applications

.16 -p- -pc 62 16-bit CompilerlCalling ConventionlC

(BCC32 option).

Use C calling convention (BCC option).

.32 -p- -pc 68 32-bit CompilerlCalling ConventionlC Use C calling convention (BCC32 option).

-po 57 CompilerlCode GenerationlFastThis Use fastthis calling

convention for passing this parameter in registers (16-bit only).

-pr 62 16-bit CompilerlCalling ConventionlRegister Use fastcall calling convention for passing pa~ameters in registers (BCC option).

-pr 68 32-bit CompilerlCalling ConventionlRegister Use fastcall calling convention for passing parameters in registers (BCC32 option).

-ps 69 32-bit CompilerlCalling ConventionlStandard call Use stdcall calling convention (32-bit only).

-r 58 CompilerlCode GenerationlAutomatic Use register variables.

-r- 58 CompilerlCode GenerationlNone Disable the use of register

variables.

-rd 58 CompilerlCode GenerationlRegister keyword Allow only declared register variables to be kept in registers.

-R 61 CompilerlDebugginglBrowser reference information in OBJs Include browser information in generated .OBJ files.

-RT 71 C++ optionslException handling/RTTllEnable r,un-time type info Enable run-time type information.

Table 3.1: Options summary (continued)

Option Page IDE setting Description

-S 81 <project manager SpeedMenu> Produce .ASM output file.

-Tstring 81 <use Tools> Pass string as an option to

TASM, TASM32, or assembler specified with -E.

-T- 81 <use Tools> Remove all previous

assembler options.

-tD 81 < TargetExpert> Make a DOS .EXE file.

-tOc 81 < TargetExpert> Make a DOS .COM file.

.16 -tOe 81 < TargetExpert> Make a DOS .EXE file.

-tW 66 16-bit CompilerlEntry/ExitlWindows all functions exportable Make the target a GUI.EXE with all functions exportable.

-tWC 81 < TargetExpert> Make the target a console

.EXE with all functions exportable.

-tWCD 81 < TargetExpert> Make the target a console

.DLL with all functions exportable.

-tWCDE 81 < TargetExpert> Make the target a console

.DLL with explicit functions exportable.

-tWO 67 16-bit CompilerlEntry/ExitlWindows DLL, all functions exported Make the target a GUI.DLL with all functions exportable.

-tWDE 67 16-bit CompilerlEntry/ExitiWindows DLL, explicit funcs exported . Make the target a GUI .DLL with explicit functions exportable.

-tWE 67 16-bit CompilerlEntry/ExitlWindows explicit functions exported Make the target a GUI .EXE with explicit functions exportable.

-tWM 81 <TargetExpert and check Multithread> Make the target multithread (32-bit only).

-tWS 67 16-bit CompilerlEntry/ExitlWindows smart callbacks, all funcs Make the tar.get a Windows .EXE that uses smart callbacks (16-bit only).

-tWSE 67 16-bit CompilerlEntry/ExitlWindows smart callbacks, explicit Make the target a Windows .EXE that uses smart callbacks, with explicit functions exportable (16-bit only).

-Uname 81 <use Local Override in project> Undefine any previous definitions of name.

-u 59 CompilerlCompiler OutputlGenerate underscores Generate underscores.

-v, -v- 60 CompilerlDebugginglDebug information in OBJs Turn on source debugging.

-vi,-vi- 60 CompilerIDebuggingIOut-of-line inline functions Control expansion of inline functions.

-va

70 C++ OptionslVirtual TableslExternal External C++ virtual tables.

-V1 70 C++ OptionslVirtual TableslPublic Public C++ virtual tables.

52 Borland C++ Users Guide

Table 3.1: Options summary (continued)

Option Page IDE setting Description

-V 70 C++ OptionslVirtual TableslSmart Use smart C++ virtual tables.

-Va 69 C++ OptionslC++ ComplPass class values via reference to temp Pass class arguments by reference to a temporary variable.

-Vb 69 C++ OptionsIC++ CompatibilitylSame size as 'this' pointer Make virtual base class pointer same size as 'this' pointer of the class (16-bit only).

.16 -Vb- 69 C++ OptionsIC++ CompatibilitylAlways near Make virtual base class pointer always near (16-bit only).

-Vc 69 C++ OptionsIC++ CompatibilitylDisable constructor displacement Don't change the layout of classes to relax restrictions on member pointers (16-bit only).

-Vf 64 16-bit CompilerlMemory Modell Far virtual tables Far C++ virtual tables (16-bit only).

-Vmd 69 C++ OptionslMember PointerlSmallest for class Use the smallest representation for member pointers.

-Vmm 69 C++ OptionslMember PointerlSupport multiple inheritance Member pointers support multiple inheritance.

-Vmp 69 C++ OptionslMember PointerlHonor precision of member pointers Honor the declared precision for all member pointer types.

-Vms 69 C++ OptionslMember PointerlSupport single inheritance Member pointers support single inheritance.

-Vmv 69 C++ OptionslMember POinterlSupport all cases Member pointers have no restrictions (most general representation).

-Vo 81 <none> Enable all backward

compatibility options (-Va, -Vb, -Vc, -Vp, -Vt, -Vv).

-Vp 70 C++ OptionsIC++ CompatibilitylPush "this" first for Pascal Pass the 'this' parameter to 'pascal' member functions as the first parameter on the stack.

-Vs 70 C++ OptionslVirtual TableslLocal Local C++ virtual tables.

-Vt 70 C++ OptionsIC++ ComplVirtual table Pointer follows data members Place the virtual table pointer after nonstatic data members.

-Vv 70 C++ OptionsIC++ Compatibilityl'deep' virtual bases Don't add the hidden members and code to classes with pointers to virtual base class members.

-W 66 16-bit CompilerlEntry/ExitlWindows all functions exportable Make the target a GUI .EXE with all functions exportable.

-WD 67 16-bit CompilerlEntry/ExitlWindows DLL, all functions exportable Make the target a Windows .DLL with all functions exportable.

Table 3.1: Options summary (continued)

Option Page IDE setting Description

-WDE 67 16~bit CompilerlEntry/ExitlWindows DLL, explicit funcs exported Make the target a Windows .DLL with explicit functions exportable.

-WE 67 16-bit CompilerlEntry/ExitlWindows explicit functions exported Make the target a Windows .EXE with explicit functions exportable.

-WM 81 <TargetExpert and check multithread> Make the target multithread (32-bit only).

-WS 67 16-bitlEntry/ExitlWindows smart callbacks, all functions exported Make the target a Windows .EXE that uses smart callbacks with all functions exportable (16-bit only).

-WSE 67 16-bitlEntry/ExitlWin smart callbacks, explicit functions exported Make the target a Windows .EXE that uses smart callbacks, with explicit functions exportable (16-bit only).

Ow! 79 MakelBreak Make on warnings Returns a non-zero return

code from the command-line compiler when there are warnings and doesn't compile to .OBJ.

-w 77 MessageslAIl Display warnings on.

-w- 77 MessageslNone Don't display warnings.

-wxxx 77 MessageslSelected (see specific warning) Enable xxx warning message.

ow-xxx 77 MessageslSelected (see specific warning) Disable xxx warning message.

-X 59 CompilerlCompiler OutputiAutodependency information (uncheck) Don't use compiler autodependency output.

-X- 59 CompilerlCompiler OutputlAutodependency information (check) Use compiler autodependency output.

-x 71 C++ OptionslException handlinglEnable exceptions Enable exception handling.

-xd 71 C++ OptionslException handlinglEnable destructor cleanup Enable destructor cleanup.

, -xp 71 C++ OptionslException handlinglEnable exception location info Enable exception location information.

-V 81 <TargetExpert DOS Overlay> Enable overlay code

generation.

-Vo 81 <edit node attributes and check Overlay this module> Overlay the compiled files.

-y 60 CompilerlDebugginglLine numbers Line numbers on.

-z

74 OptimizationslSizelSuppress redundant loads Enable register load suppression optimization.

-zAname 66 16-bit CompilerlSegment Names CodelCode Class Code class.

.-zBname 65 16-bit CompilerlSegment Names DatalUnlnitialized Data Class BSS class.

-zCname 66 16-bit CompilerlSegment Names CodelCode Segment Code segment.

-zDname 65 16-bit CompilerlSegment Names DatalUnlnitialized Data Segment BSS segment.

-zEname 65 16-bit CompilerlSegment Names Far DatalFar Data Segment Far segment (16-bit only).

-zFname 65 16-bit CompilerlSegment Names Far DatalFar Data Class Far class (16-bit only).

54 Borland C++ Users Guide

Table 3.1: Options summary (continued)

Option Page IDE setting

-zGname 65 16-bit CompilerlSegment Names DatalUnlnitialized Data Group -zHname 65 16-bit CompilerlSegment Names Far DatalFar Data Group -zPname 66 16-bit CompilerlSegment Names CodelCode Group

-zRname 65 16-bit CompilerlSegment Names Datallnitialized Data Segment -zSname 65 16-bit CompilerlSegment Names Datallnitialized Data Group -zTname 65 16-bit CompilerlSegment Names Datallnitialized Data Class

Description BSS group.

Far group (16-bit only).

Code group.

Data segment.

Data group.

Data class.

-zVname 65 16-bit CompilerlSegment Names Far DatalVirtual Table Segment Far virtual segment (16-bit only).

-zWname 66 16-bit CompilerlSegment Names Far DatalVirtual Table Class -zX: 82 <none>

• Default for both 16- and 32-bit .1616-bit default

Far virtual class (16-bit only).

Use default name for X; X is A-H, P, R, S, T, V, or W .

.32 32-bit default

Directories

-Ipath Include searches path (the drive specifier or path name of a subdirectory) for include files (in addition to searching the standard places). A drive specifier is a single letter, either uppercase or lowercase, followed by a colon (:). A directory is any valid directory or directory path. You can use more than one -I (which is an uppercase I) directory option.

-Lpath Library forces the linker to get the COx.OBJ start-up object file and the Borland C++ library files from the named directory. By default, the linker looks for them in the current directory.

Source is the directory where the compiler looks for source code.

Intermediate is where the compiler places any temporary files it creates.

-npath Final places any final output files (.OBJ, .I, or .ASM) created by the compiler in the directory or drive named by path.

You can enter multiple directories on the command line in the following ways:

• You can stack multiple entries with a single -L or -I option by using a semicolon:

BCC.EXE -Ldirnamel;dirname2;dirname3 -linel;ine2;ine3 myfile.e

• You can place more than one of each option on the command line, like this:

BCC.EXE -Ldirnamel -Ldirname2 -Ldirname3 -linel -linc2 -line3 myfile.e

File-search algorithms

• You can mix listings:

BCC.EXE -Ldirnamel;dirname2 -Ldirname3 -linel;ine2 -line3 myfile.e If you list multiple -L or -I options on the command line, the result is cumulative: The compiler searches all the directories listed, in order from left to right. The IDE also supports multiple library directories.

The Borland C++ include-file search algorithms search for the header files listed in your source code in the following way:

• If you put an #include <somefile .h> statement in your source code, Borland C++ searches for somefile.h only in the specified include directories,.

• If, on the other hand, you put an #include "somefile.h" statement in your code, Borland C++ searches for somefile.h first in the current directory; if it doesn't find the header file there, it then searches in the include

directories specified in the command line.

The library file search algorithms are similar to those for include files:

• Implicit libraries: Borland C++ searches for implicit libraries only in the specified library directories; this is similar to the search algorithm for

#include <somefile.h>. Implicit library files are the ones Borland C++

automatically links in and the start-up object file (COx.OB]).

• Explicit libraries: Where Borland C++ searches for explicit

(user-specified) libraries depends in part on how you list the library file name.

Explicit library files are ones you list on the command line or in a project file; these are file names with a .LIB extension .

• If you list an explicit library file name with no drive or directory (like this: mylib.lib), Borland C++ searches for that library in the current directory first. Then (if the first search was unsuccessful), it looks in the specified library directories. This is similar to the search algorithm for

#include 1/ somefile.h" .

• If you list a user-specified library with drive and/or directory

information (like this: c :mystuff\mylibl.lib), Borland C++ searches only in the location you explicitly listed as part of the library path name and not in the specified library directories.

CompilerlDefines

56

Macro definitions let you define and undefine macros (also called manifest or symbolic constants) on the command line or in the IDE. Macros defined

Borland C++ Users Guide

Options I t-JroJectlljompllen UeTlneS

on the command line or in the Options Setting dialog box override those in your source file. Type IDE macro definitions in the Defines box under the Code Generation I Settings topic.

-Dname Defines the named identifier name to the null string. separate macros with a semicolon.

-Dname=string Defines the named identifier name to the string string after the equal sign.

string can't contain any spaces or tabs. Separate macros with a semicolon.

Borland C++ lets you make multiple #define entries on the command line in any of the following ways:

• You can include multiple entries after a single -0 option by separating entries with a semicolon:

BCC.EXE -Dxxxiyyy=lizzz=NO MYFILE.C

• Multiple -0 options can be included if they are separated by spaces:

BCC.EXE -Dxxx -Dyyy=l -Dzzz=NO MYFILE.C

• You can mix multiple -0 listings with semicolon entries:

BCC.EXE -Dxxx -Dyyy=lizzz=NO MYFILE.C

Im Dokument or an (Seite 59-70)