OGRECave/ogre

Prevent static initialization order fiasco for all class constants

Open

#3,321 opened on Apr 14, 2025

View on GitHub
 (0 comments) (0 reactions) (0 assignees)C++ (1,032 forks)auto 404
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:

Contributor guide