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

ProjectOptionsC++ CompilerC++ Compatibility 

Use this dialog box to set specifically C++ Compiler Compatibility options.  

These options provide backward compatibility with previous versions of the compiler. In general, these options should not be set to true unless such compatibility is required. Their default value is false.

Build Configuration options 
Description 
Build Configuration 
Displays the active build configuration. 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.  

Note: There are several compatibility options that have switches beginning with -Vb
. These options are summarized in the following table:

Switch 
Meaning 
-Vb  
Turn on all -Vb switches.  
-Vb+  
Turn on all -Vb switches.  
-Vb-  
Turn off all -Vb switches.  
-Vb.  
Reset all -Vb switches.  
-Vbe  
Allow old-style explicit template specialization.  
-Vbn  
Allow calling a non-const member function for a const object.  
-Vbo  
Use old overload resolution rules.  
-Vbr  
Allow non-const reference binding.  
-Vbs  
Do not treat string literals as const.  
-Vbx  
Allow explicit template specializations as member functions.  

 

C++ Compatibility options 
Description 
Non-const calls for const object (-Vbn) 
Allow calling a non-const member function for a const object. Default = false  
Old overload resolution (-Vbo) 
Use old overload resolution rules. Default = false  
Non-const reference binding (-Vbr) 
Allow non-const reference binding. Default = false  
Explicit template specialization as member function (-Vbx)  
Allow explicit template specializations as member functions. Default = false  
Old-style explicit template specialization (-Vbe) 
Allow old-style explicit template specialization. Default = false  
Old style class arguments (-Va) 
Supports old style class arguments. Default = false  
Constructor displacements (-Vc) 
Supports constructor displacements. Default = false  
Old for-statement scoping (-Vd) 
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 -Vd
} //end of block containing for loop
If this option is disabled (the default), the variablei goes out of scope when processing reaches the end of the for loop. Because of this, you'll get an Undefined Symbol compilation error if you compile this code with this option disabled.
If this option is set (-Vd), 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  
Old Borland class layout (-VI) 
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  
Push 'this' first (-Vp) 
Like Pascal, pushes 'this' first. The compiler typically pushes parameters on the stack from right to left. Default = false  
VTable in front (-Vt) 
Puts virtual table pointer at front of object layout. Default = false  
'Slow' virtual base pointers (-Vv) 
Uses 'slow' virtual base pointers. Default = false  
Zero-length empty class member functions (-Vx) 
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  
Zero-length empty base class (-Ve) 
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  

 

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!