RAD Studio (Common)
ContentsIndex
PreviousUpNext
C++ Compiler Advanced

ProjectOptionsC++ CompilerAdvanced 

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

Build Configuration options 
Description 
Build Configuration 
Displays the name of the current build configuration associated with the options on this page. There are three default build configurations: Base, Debug, and Release.  
Apply Options... 
Displays the Apply Option Set dialog box to apply the options in a named option set to the current configuration.  

 

Common items 
Description 
Value from <parent configuration or option set> 
Indicates the value in the parent build configuration or referenced option set. If you change this value here, the change will potentially affect the Base configuration (that is, if you click OK on the Project->Options dialog and subsequently build your project).  
Inherit 
Indicates whether inheritance (from a parent configuration) is on or off for the option. To control inheritance, click the option, and then open the associated generic list dialog box by clicking the Ellipsis that appears. The Inherit values from parent configuration checkbox controls whether your current build configuration inherits the values listed in the lower box of the generic list dialog box.  
<any item in red print> 
Indicates that this option has secondary options available. To view the secondary options, click the + sign in front of the option in red.  
<any item in boldface print> 
Indicates that the value of this option has been changed from the value in the parent configuration or referenced option set.  
Down Arrow Pop-Up Button 
Appears after you click an option that has a set of available choices (such as True, False). Click Down Arrow to display and choose the value you want from the available choices.  
Ellipsis Pop-Up Button 
Appears after you click an option whose value is either of the following:
  • An ordered list that you enter and then arrange in the desired order, such as a list of defines or search paths. Clicking Ellipsis invokes the generic ordered list dialog box.
  • A single filename, directory or folder name. Clicking Ellipsis invokes the standard Open file or Browse for folder dialog box.
 

 

Assembler Options 
Description 
Assembler options 
Enter any additional assembler options (such as -TX or -T) that you want for the current project. Passes the specified option(s) to the assembler that you specify with the -E option.  
Compile to .ASM (-S), then assemble to .OBJ (-B) 
Causes the compiler to first generate an .ASM file from your C++ (or C) source code (same as the -S command-line option). The compiler then calls TASM32 (or the assembler specified with the -E option) to create an .OBJ file from the .ASM file. The .ASM file is then deleted.
Your program will fail to compile with the -B option if your C or C++ source code declares static global variables that are keywords in assembly. This is because the compiler does not precede static global variables with an underscore (as it does other variables), and the assembly keywords will generate errors when the code is assembled. Default = False  
Compile to assembly (-S) 
Causes the compiler to generate an .ASM file from your C++ (or C) source code. Default = False  
Specify which assembler to use (-E) 
Assemble instructions using the specified filename as the assembler. The 32-bit compiler uses TASM32 as the default assembler. See the description of the Ellipsis pop-up button, above.  

 

Floating point options 
Description 
Correct FDIV flaw (-fp) 
Some early Pentium chips do not perform specific floating-point division calculations with full precision. Although chances of encountering this problem are slim, this switch inserts code that emulates floating-point division, so that you are assured of the correct result. This option decreases your program's FDIV instruction performance.
Use of this option only corrects FDIV instructions in modules that you compile. The runtime library also contains FDIV instructions that are not modified by setting this switch. To correct the runtime libraries, you must recompile them using this switch.
The following functions use FDIV instructions in assembly language that are not corrected if you use this option: acos, acosl, acos, asinasinl, atanatan2, atan2latanl, coscosh, coshlcosl, expexpl, fmodfmodl, powpow10, pow10lpowl, sinsinh, sinhlsinl, tantanh, tanhltanl
In addition, this switch does not correct functions that convert a floating-point number to or from a string (such as printf or scanf).
Default = False  
Fast floating point (-ff) 
Floating-point operations are optimized without regard to explicit or implicit type conversions. Calculations can be faster than under ANSI operating mode.
The purpose of the fast floating-point option is to allow certain optimizations that are technically contrary to correct C semantics.
double x; x = (float) (3.5*x);
To execute this correctly, x is multiplied by 3.5 to give a double that is truncated to float precision, then stores as a double in x. Under fast floating-point operation, the long double product is converted directly to a double. Since very few programs depend on the loss of precision on passing to a narrower floating-point type, fast floating point is on by default.
When this option is disabled (-ff-), the compiler follows strict ANSI rules regarding floating-point conversions.
Default = True  
Quiet floating point compares (-fq) 
Use the quiet floating point instruction (FUCOMP). Default = True  

 

Other options 
Description 
Additional options to pass to the compiler 
Enter any additional compiler options that you want to add for the current project.  
Code page (-CP) 
Enables support for user-defined code pages. Its primary use is to tell the compiler how to parse and convert multi-byte character strings (MBCS).
There are two distinct areas where code pages come into effect:
  1. String constants, comments, #error, and #pragma directives
  2. Wide-char string constants (as specified by L'<MBCS string>')
For MBCS strings belonging to the first set, you must specify the correct codepage using a call to the Windows API function IsDBCSLeadByteEx. Using this function, specify the code page to correctly parse the MBCS strings for a particular locale (this, for example, enables the compiler to correctly parse backslashes in MBCS trail bytes).
For MBCS strings belonging to the second set (wide-char string constants), specify the correct code page to convert the MBCS strings to Unicode strings using the Windows API function MultiByteToWideChar.
Syntax
Enable code paging with the following command-line switch:
-CPnnnn
In this syntax, nnnn is the decimal value of the code page you need to use for your specific locale.
The following rules apply:
  1. When setting code paging, numeric settings for nnnn must adhere to the Microsoft NLS Code Page ID values. For example, use 437 for United States MS-DOS applications. Use 932 for Japanese.
  2. The numeric value nnnn must be a valid code page supported by the OS.
  3. Users may need to install the relevant Windows NLS files to make certain Asian locales and code pages accessible. Refer to the Microsoft NLS Code Page documentation for specifics.
  4. If you do not specify a code page value, the compiler calls the Windows API function GetACP to retrieve the system's default code page and uses this value when handling strings as indicated above.
Default = to not use a code page
See the description of the Ellipsis pop-up button, above.  
Unsigned char type (-K) 
The compiler treats char declarations as if they were unsigned char type, which provides compatibility with other compilers.
Default = False  

 

Source options 
Description 
Enable nested comments (-C) 
Nests comments in your C and C++ source files.
Nested comments are not allowed in standard C implementations, and they are not portable.
Default = False  
Identifier length (-i) 
Specifies the number of significant characters (those which are recognized by the compiler) in an identifier.
Except in C++, which recognizes identifiers of unlimited length, all identifiers are treated as distinct only if their significant characters are distinct. This includes variables, preprocessor macro names, and structure member names.
Valid numbers for length are 0, and 8 to 250, where 0 means use the maximum identifier length of 250.
By default, C++Builder uses 250 characters per identifier. Other systems (including some UNIX compilers) ignore characters beyond the first eight. If you are porting to other environments, you might want to compile your code with a smaller number of significant characters, which helps you locate name conflicts in long identifiers that have been truncated. Default = 250  

 

Strings options 
Description 
Merge duplicate strings (-d) 
Merges two literal strings when one matches another. This produces smaller programs (at the expense of a slightly longer compile time), but can introduce errors if you modify one string.
Default = False  
Read-only strings (-dc) 
Put memory allocated for strings into the read-only data segment.
Default = False  
Writable strings (-dw) 
Put memory allocated for strings into the writable data segment.
Default = False  

 

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