-qrtti, -fno-rtti (-qnortti) (C++ only)

Purpose

Generates runtime type identification (RTTI) information for exception handling and for use by the typeid and dynamic_cast operators.

Syntax

Read syntax diagramSkip visual syntax diagram
        .-rtti---.   
>>- -q--+-nortti-+---------------------------------------------><

Read syntax diagramSkip visual syntax diagram
>>- -f--no-rtti------------------------------------------------><

Defaults

-qrtti

Usage

For improved runtime performance, suppress RTTI information generation with the -fno-rtti (-qnortti) setting.

You should be aware of the following effects when specifying the -qrtti compiler option:
  • Contents of the virtual function table will be different when -qrtti is specified.
  • When linking objects together, all corresponding source files must be compiled with the correct -qrtti option specified.
  • If you compile a library with mixed objects (-qrtti specified for some objects, -fno-rtti (-qnortti) specified for others), you may get an undefined symbol error.

Predefined macros

  • __GXX_RTTI is predefined to a value of 1 when -qrtti is in effect; otherwise, it is undefined.
  • __NO_RTTI__ is defined to 1 when -fno-rtti (-qnortti) is in effect; otherwise, it is undefined.
  • __RTTI_ALL__ is defined to 1 when -qrtti is in effect; otherwise, it is undefined.
  • __RTTI_DYNAMIC_CAST__ is predefined to a value of 1 when -qrtti is in effect; otherwise, it is undefined.
  • __RTTI_TYPE_INFO__ is predefined to a value of 1 when -qrtti is in effect; otherwise, it is undefined.

Related information



Voice your opinion on getting help information Ask IBM compiler experts a technical question in the IBM XL compilers forum Reach out to us