RAD Studio (Common)
ContentsIndex
PreviousUpNext
C++ Compiler General Compilation

ProjectOptionsC++ CompilerGeneral Compilation 

Use this dialog box to set C++ Compiler General Compilation options.

Build Configuration options 
Description 
Build Configuration 
Displays the active build configuration. You can use the drop-down menu to select another build configuration.  
Save As... 
Displays the Save As dialog box to save the current configuration's options to a file that can be loaded as a named option set.  
Load... 
Displays the Apply Option Set dialog box to apply the options in a named option set to the current configuration.  

 

Compilation options 
Description 
Instruction Set 
80386 (-3)*
Generates 80386 protected-mode compatible instructions. This is the default.
80486 (-4)
Generates i486 protected-mode compatible instructions.
Pentium (-5)
Generates Pentium instructions.
While this option increases the speed at which the application runs on Pentium machines, expect the program to be a bit larger than when compiled with the 80386 or i486 options. In addition, Pentium-compiled code sustains a performance hit on non-Pentium systems.
Pentium Pro (-6)
Generates Pentium Pro instructions.  
Data Alignment 
Byte (-a1)
Does not force alignment of variables or data fields to any specific memory boundaries. The compiler aligns data at even or odd addresses, depending on the next available address.
While byte alignment produces more compact programs, the programs tend to run slower. The other data alignment options increase the speed at which 80x86 processors fetch and store data.
Word (-a2)
2 byte data alignment. Aligns non-character data at even addresses. Automatic and global variables are aligned properly. char and unsigned char variables and fields can be placed at any address; all others are placed at even-numbered addresses.
Double word (-a4)*
4 byte data alignment. Aligns non-character data at 32–bit word (4–byte) boundaries. Data type sizes of less than four bytes are aligned on their type size. This is the default.
Quad word (-a8)
8 byte data alignment. Aligns non-character data at 64–bit word (8–byte) boundaries. Data with type sizes of less than eight bytes are aligned on their type size.
Paragraph (-a16)
16 byte data alignment. Aligns non-character data at 128–bit (16–byte) boundaries. Data with type sizes of less than 16 bytes are aligned on their type size.  
Register variables 
None (-r-)*
Disables the use of register variables. Tells the compiler not to use register variables, even if you have used the register keyword. This is the default.
Explicit (-rd)
Use register variables only if you use the register keyword and a register is available. Use this option or the Always option (-r) to optimize the use of registers.
You can use -rd in #pragma options.
Always (-r)
Automatically assign register variables if possible, even when you do not specify a register variable by using the register keyword.
Generally, you can use Always, unless you are interfacing with preexisting assembly code that does not support register variables.  
Calling convention 
Pascal (-p)
Tells the compiler to generate a Pascal calling sequence for function calls (do not generate underbars, all uppercase, calling function cleans stack, pushes parameters left to right). This is the same as declaring all subroutines and functions with the __pascal keyword. The resulting function calls are usually smaller and faster than those made with the C (-pc) calling convention. Functions must pass the correct number and type of arguments.
You can use the __cdecl, __fastcall, or __stdcall keywords to specifically declare a function or subroutine using another calling convention.
C (-pc)*
Tells the compiler to generate a C calling sequence for function calls (generate underbars, case sensitive, push parameters right to left). This is the same as declaring all subroutines and functions with the __cdecl keyword. Functions declared using the C calling convention can take a variable parameter list (the number of parameters does not need to be fixed).
You can use the __pascal, __fastcall, or __stdcall keywords to specifically declare a function or subroutine using another calling convention.
This is the default.
_msfastcall (-pm)
Tells the compiler to substitute the __msfastcall calling convention for any function without an explicitly declared calling convention.
Fastcall (register) (-pr)
Forces the compiler to generate all subroutines and all functions using the Register parameter-passing convention, which is equivalent to declaring all subroutine and functions with the __fastcall keyword. With this option enabled, functions or routines expect parameters to be passed in registers.
You can use the __pascal, __cdecl, or __stdcall keywords to specifically declare a function or subroutine using another calling convention.
stdcall (-ps)
Tells the compiler to generate a stdcall calling sequence for function calls (does not generate underscores, preserve case, called function pops the stack, and pushes parameters right to left). This is the same as declaring all subroutines and functions with the __stdcall keyword. Functions must pass the correct number and type of arguments.
You can use the __cdecl, __pascal, __fastcall keywords to specifically declare a function or subroutine using another calling convention.  
Compliance 
ANSI (-A)
Use ANSI keywords and extensions. Compiles C and C++ ANSI-compatible code, allowing for maximum portability. Non-ANSI keywords are ignored as keywords.
K & R (-AK)
Use Kernighan and Ritchie (KR) keywords and extensions. Tells the compiler to recognize only the KR extension keywords and treat any of CodeGear's C++ extension keywords as normal identifiers.
Borland (also -A-) (-AT)*
Use Borland/CodeGear C++ keywords and extensions. Tells the compiler to recognize CodeGear's extensions to the C language keywords, including near, far, huge, asm, cdecl, pascal, interrupt, _export, _ds, _cs, _ss, _es, and the register pseudovariables ( _AX, _BX, and so on).
This is the default.
Unix System V (-AU)
Use UNIX System V keywords and extensions. Tells the compiler to recognize only UNIX V keywords and treat any of CodeGear's C++ extension keywords as normal identifiers.
Hint:If you get declaration syntax errors from your source code, check that this option is set to Borland Extensions.  
Extended error info (-Q) 
Compiler generates more extended information on errors. (Default = false)  
Standard stack frames (-k) 
Generates a standard stack frame (standard function entry and exit code). This is helpful when debugging, since it simplifies the process of stepping through the stack of called subroutines.
When this option is off, any function that does not use local variables and has no parameters is compiled with abbreviated entry and return code. This makes the code smaller and faster.
The Standard Stack Frame option should always be on when you compile a source file for debugging.
(Default = false)  
Integer-sized enums (-b) 
Allocates a whole word (a four-byte int for 32–bit programs) for enumeration types (variables of type enum).
When this option is off (-b-), the compiler allocates the smallest integer that can hold the enumeration values: the compiler allocates an unsigned or signed char if the values of the enumeration are within the range of 0 to 255 (minimum) or -128 to 127 (maximum), or an unsigned or signed short if the values of the enumeration are within the following ranges:
0..65535 or -32768..32767.
The compiler allocates a four-byte int (32-bit) to represent the enumeration values if any value is out of these ranges.
(Default = true)  
Treat warnings as errors (-w!) 
Causes the compiler to treat warnings as errors. (Default = false)  
Force C++ compile (-P) 
Causes the compiler to compile all source files as C++ files, regardless of their extension. (Default = false)  
Batch compile 
Enable batch file compile. (Default = false)  

 

General option 
Description 
Default 
Saves the current settings as the default for each new project.  
Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!