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

ProjectOptionsC++ CompilerAdvanced 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.  

 

Floating point options 
Description 
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)  
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)  
Quiet floating point compares (-fq) 
Use the quiet floating point instruction (FUCOMP). (Default = true)  

 

Strings options 
Description 
Writable strings (-dw) 
Put memory allocated for strings into the writable data segment. (Default = false)  
Read-only strings (-dc) 
Put memory allocated for strings into the read-only data segment. (Default = false)  
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)  

 

Other options 
Description 
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.
The default is to not use a code page.  
Other options 
Any additional options to pass to the compiler.  
Default char to unsigned (-K) 
The compiler treats char declarations as if they were unsigned char type, which provides compatibility with other compilers. (Default = false)  

 

Source options 
Description 
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.  
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)  

 

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!