The init_priority variable attribute

The variable attribute init_priority is an extension to C++ that allows you to control the initialization order of static objects defined in namespace scope across multiple compilation units.

Read syntax diagramSkip visual syntax diagram
init_priority variable attribute syntax

>>-__attribute__------------------------------------------------>

>--((--+-------------------+--+-------------------------+--))--><
       +-init_priority-----+  '-(--relative_priority--)-'       
       '-__init_priority__-'                                    

The relative_priority is a constant integral expression between 101 and 65535, inclusive. A lower number indicates a higher priority.


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