OGRECave/ogre
View on GitHubPrevent static initialization order fiasco for all class constants
Open
#3,321 opened on Apr 14, 2025
good first issuepapercut
Repository metrics
- Stars
- (4,617 stars)
- PR merge metrics
- (PR metrics pending)
Description
There is a possibility of static initialization order fiasco when the order in which objects with static storage duration are initialized is ambiguous (see example code to reproduce the problem). Several classes were updated recently to use constexpr for initializing static constants, and these fixes should be applied to other class constants as well: