C++ Compiler Compatibility
Go Up to C++ Compiler
Project > Options > C++ Compiler > Compatibility
Use this dialog box to set specific C++ compiler compatibility options.
The options on this dialog box provide backward compatibility with previous versions of the compiler. In general, these options should only be set to True
when such compatibility is required. Their default values are typically False
.
Contents
Options | Description |
---|---|
Target, Apply, Save |
See Target Options. |
Common items |
C++ Compatibility Options
C++ Compatibility Options | Description | Compiler switches | ||||||
---|---|---|---|---|---|---|---|---|
bcc32 | bcc32c | bcc64 | bccosx | bcciosarm | bcciosarm64 | bccaarm | ||
'Slow' virtual base pointers |
Uses 'slow' virtual base pointers. Default = False |
-Vv |
N/A |
Platform not supported |
-Vv |
Platform not supported |
Platform not supported |
Platform not supported |
Constructor displacements |
Supports constructor displacements. Default = False |
-Vc |
N/A |
Platform not supported |
-Vc |
Platform not supported |
Platform not supported |
Platform not supported |
Explicit template specialization as member function |
Allow explicit template specializations as member functions. Default = False |
-Vbx |
N/A |
Platform not supported |
-Vbx |
Platform not supported |
Platform not supported |
Platform not supported |
Old Borland class layout |
This is a backward compatibility switch that causes the C++ compiler to lay out derived classes the same way it did in older versions of C++Builder. Enable this option if you need to compile source files that you intend to use with older versions of C++Builder (for example, if you need to work with a DLL that you cannot recompile, or if you have older data files that contain hardwired class layouts). Default = False |
-Vl |
N/A |
Platform not supported |
-Vl |
Platform not supported |
Platform not supported |
Platform not supported |
Old-style class arguments |
Supports old style class arguments. Default = False |
-Va |
N/A |
Platform not supported |
-Va |
Platform not supported |
Platform not supported |
Platform not supported |
Old-style explicit template specialization |
Allow old-style explicit template specialization. Default = False |
-Vbe |
N/A |
Platform not supported |
-Vbe |
Platform not supported |
Platform not supported |
Platform not supported |
Old style virdef generation |
Uses old-style virdef generation. Default = False |
-Vs |
N/A |
Platform not supported |
-Vs |
Platform not supported |
Platform not supported |
Platform not supported |
Push 'this' first |
Like Pascal, pushes 'this' first. The compiler typically pushes parameters on the stack from right to left. Default = False |
-Vp |
N/A |
Platform not supported |
-Vp |
Platform not supported |
Platform not supported |
Platform not supported |
VC++ compatibility |
To provide compatibility with Microsoft Visual C++, substitutes |
-VM |
N/A |
Platform not supported |
Platform not supported |
Platform not supported |
Platform not supported |
Platform not supported |
VTable in front |
Puts virtual table pointer at front of object layout. Default = False |
-Vt |
N/A |
Platform not supported |
-Vt |
Platform not supported |
Platform not supported |
Platform not supported |
Zero-length empty base class |
Usually the size of a class is at least one byte, even if the class does not define any data members. When you set this option, the compiler ignores this unused byte for the memory layout and the total size of any derived classes; empty base classes do not consume space in derived classes. Default = False |
-Ve |
N/A |
Platform not supported |
-Ve |
Platform not supported |
Platform not supported |
Platform not supported |
Zero-length empty class member functions |
Usually the size of a data member in a class definition is at least one byte. When this option is enabled, the compiler allows an empty structure of zero length. Default = False |
-Vx |
N/A |
Platform not supported |
-Vx |
Platform not supported |
Platform not supported |
Platform not supported |
General Options
General Options | Description | Compiler switches | ||||||
---|---|---|---|---|---|---|---|---|
bcc32 | bcc32c | bcc64 | bccosx | bcciosarm | bcciosarm64 | bccaarm | ||
Backward compatibility |
Enables all the compatibility |
-Vb |
N/A |
Platform not supported |
-Vb |
Platform not supported |
Platform not supported |
Platform not supported |
Disable lexical digraph scanner |
Disables the lexical digraph scanner. Digraphs are two character sequences that stand in for a single character that may be hard to produce on certain keyboards. If this option is true, then such diagraphs are not recognized. Default = False |
-Vg |
N/A |
Platform not supported |
-Vg |
Platform not supported |
Platform not supported |
Platform not supported |
Don't collapse ref-to-ref |
Previously, a reference to a reference was illegal. The new default behavior is to follow the C++11 rules. The compiler now collapses the two references. For example: typedef int & intr;
typedef intrr &;
The type |
-Vbc |
N/A |
Platform not supported |
-Vbc |
Platform not supported |
Platform not supported |
Platform not supported |
Don't mangle calling convention |
When this option is set, the compiler disables the distinction of function names where the only possible difference is incompatible code generation options. For example, with this option set, the linker does not detect if a call is made to a __fastcall member function with the cdecl calling convention.This option is provided for backward compatibility only; it lets you link old library files that you cannot recompile. Default = False |
-VC |
N/A |
Platform not supported |
-VC |
Platform not supported |
Platform not supported |
Platform not supported |
Enable all compatibility options |
Enables most of the compatibility options used with old code:
Default = False |
-Vo |
N/A |
Platform not supported |
-Vo |
Platform not supported |
Platform not supported |
Platform not supported |
Enable new operator names |
Enables new operator names such as 'and', 'or', 'and_eq', 'bitand', and so forth. Default = False |
-Vn |
N/A |
Platform not supported |
-Vn |
Platform not supported |
Platform not supported |
Platform not supported |
for -statement scoping |
Specifies the scope of variables declared in for loop expressions. The output of the following code segment changes, depending on the setting of this option: int main(void)
{
for(int i=0; i<10; i++)
{
cout << "Inside for loop, i = " << i << endl;
} //end of for-loop block
cout << "Outside for loop, i = " << i << endl; //error without this option
} //end of block containing for loop
If this option is disabled (the default), the variable i goes out of scope when processing reaches the end of the for loop. Because of this, you will get an Undefined Symbol compilation error if you compile this code with this option disabled. If the for -statement scoping option is enabled, the variable i goes out of scope when processing reaches the end of the block containing the for loop. In this case, the code output would be: Inside for loop, i = 0 ... Outside for loop, i = 10 Default = False |
-Vd |
N/A |
Platform not supported |
-Vd |
Platform not supported |
Platform not supported |
Platform not supported |
Global functions in segments |
Generates all global functions in their own virtual or weak segment. |
-VA |
N/A |
Platform not supported |
-VA |
Platform not supported |
Platform not supported |
Platform not supported |
Microsoft header search algorithm |
Uses Microsoft search algorithms to locate the header files. |
-VI |
N/A |
Platform not supported |
-VI |
Platform not supported |
Platform not supported |
Platform not supported |
Native code for MBCS |
Emits native code instead of Unicode for multi-byte character. |
-Vw |
N/A |
Platform not supported |
-Vw |
Platform not supported |
Platform not supported |
Platform not supported |
Non-const calls for const object |
Allow calling a non-const member function for a const object. |
-Vbn |
N/A |
Platform not supported |
-Vbn |
Platform not supported |
Platform not supported |
Platform not supported |
Non-const reference binding |
Allow non-const reference binding. |
-Vbr |
N/A |
Platform not supported |
-Vbr |
Platform not supported |
Platform not supported |
Platform not supported |
Non-const string literals |
Do not treat string literals as const. |
-Vbs |
N/A |
Platform not supported |
-Vbs |
Platform not supported |
Platform not supported |
Platform not supported |
Old 'using' rules in templates |
Use the old Borland rules for 'using' in templates. |
-Vbu |
N/A |
Platform not supported |
-Vbu |
Platform not supported |
Platform not supported |
Platform not supported |
Old 8.3 include search |
Use old 8.3 search algorithm to locate header files. |
-Vi |
N/A |
Platform not supported |
Platform not supported |
Platform not supported |
Platform not supported |
Platform not supported |
Old overload resolution |
Use old overload resolution rules. |
-Vbo |
N/A |
Platform not supported |
Platform not supported |
Platform not supported |
Platform not supported |
Platform not supported |
Old type rules for ternary operators |
Use the old Borland type rules for ternary operators. |
-Vbt |
N/A |
Platform not supported |
-Vbt |
Platform not supported |
Platform not supported |
Platform not supported |
Reverse Multi-character constants |
The compiler reverses the order of Multi-character constants. |
-Vr |
N/A |
Platform not supported |
-Vr |
Platform not supported |
Platform not supported |
Platform not supported |
-Vb Compiler Options for BCC32/BCCOSX
Note: Several compatibility options have compiler switches for BCC32 and BCCOSX that begin with -Vb. BCC64 does not support these compatibility options. The -Vb compatibility options are summarized in the following table:
Command-Line Switch | Meaning |
---|---|
-Va |
Support old-style class arguments. |
-Vb |
Turn on all -Vb switches. Enables backward compatibility with Bcc versions 5.8.2 and earlier. |
-Vb+ |
Turn on all -Vb switches. |
-Vb- |
Turn off all -Vb switches. |
-Vb. |
Reset all -Vb switches to their default values. Available only on the command line, not in the IDE. |
-Vbc |
Do not collapse reference to reference and allow qualified references. |
-Vbe |
Allow old-style explicit template specialization. |
-Vi |
Use old 8.3 algorithm to locate header files. |
-Vbn |
Allow calling of non-const or non-volatile member function for a const or volatile object. |
-Vbo |
Use old Borland overload resolution rules. |
-Vbr |
Allow old Borland rules for reference binding. |
-Vbs |
Treat string literals as non-const. |
-Vbt |
Use old Borland type rules for ternary operators. |
-Vbu |
Use old Borland rules for using in templates. |
-Vbx |
Allow explicit template specializations as member functions. |
See Also
- Options Not Supported by Clang-enhanced C++ Compilers
- C++ (Shared Options)
- BCC32, the C++ Compiler for 32-bit Windows
- BCC32C.EXE
- BCC64, the C++ Compiler for 64-bit Windows
- BCCOSX, the C++ Compiler for OS X
- BCCIOSARM, the C++ Compiler for the 32-bit iOS Device
- BCCIOSARM64, the C++ Compiler for the 64-bit iOS Device
- BCCAARM, the C++ Compiler for Android