TICS Coding Standard Viewer 
TIOBE Software Quality Framework
Print-friendly version
©TIOBE Software www.tiobe.com
 
C++ Coding Standard
Search

Rule:  POR#012

Synopsis:Do not assume that static objects are initialized in any special order when they are spread over multiple source files
Language:C++
Severity Level:1
Category:Portability


Description:

It is specified in C++ that static objects declared within one source file are initialized in the order they are noted in that file. Usage of this knowledge is acceptable. However when multiple source files are used to compose a module, the initialization order of static objects spread over multiple source files is unpredictable. To solve this problem, it is acceptable when the initialization order needs to be known to place related static objects in one source file.



Literature References:
Ellemtel P. Rec. 15