Download H8S, H8/300 Series C/C++ Compiler Package Application Note

Transcript
Section 8 Efficient C++ Programming Techniques
• Unsupported keywords:
An error message will be output if either of the following keywords is included.
catch, const_cast, dynamic_cast, explicit, mutable, namespace, reinterpret_cast, static_cast, template, throw, try, typeid,
typename, using
• Unsupported language specifications:
A warning message will be output if either of the following language specifications is included.
Multiple inheritance, virtual base class
8.3.2
Run-time Type Information
• Description:
In C++, a class object with a virtual function may have a type identifiable only at run-time.
A run-time identification function is available to provide support in such a situation.
To use this function in C++, use the type_info class, typeid operator, and dynamic_cast operator.
For the Compiler, specify the following option to use run-time type information.
Additionally, specify the following option at linkage to start up the prelinker.
• Specification method:
Dialog menu:
CPU tab, Enable/disable runtime type information
Command line: rtti=on | off
Dialog menu:
Link/Library tab, Category: Input tab, Prelinker control
Then, select Auto or Run prelinker.
Command line: Do not specify noprelink (default).
Rev.3.00 2005.09.12 8-9
REJ05B0464-0300