Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22016

Initialization of inline static data

$
0
0

I am wondering how and when static inline data is initialized in C++ (for example in gcc or clang). I know it is a question specific to some architecture and it is not related to the C++ standard.

I know that for static/global non-inline data gcc is using the .init and .fini sections for constructing and destructing objects with such qualifiers but this won't work for inline static data because it can be initialized in many translation unit so the init section will end up with many initializations to do for a single object which is wrong.

Does anyone know how the implementation works?

To be clear I am interested in the implementation of the initialization of those inline variables.


Viewing all articles
Browse latest Browse all 22016

Trending Articles