C++ Compiler Advanced

From RAD Studio
Jump to: navigation, search

Go Up to C++ Compiler Index

Project > Options > C++ Compiler > Advanced

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

Options Description

Build Configuration Options

Described in Build Configuration Options.

Common Options

Described in Common Items on Project Options Pages.


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 in Common Items on Project Options Pages.



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, asin, asinl, atan, atan2, atan2l, atanl, cos, cosh, coshl, cosl, exp, expl, fmod, fmodl, pow, pow10, pow10l, powl, sin, sinh, sinhl, sinl, tan, tanh, tanhl, tanl

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 in Common Items on Project Options Pages.

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.

Personal tools
Newest Version: XE
In other languages