[clang] [clang] Improve the documentation for the init_priority attribute (PR #123098)
Steven Wu via cfe-commits
cfe-commits at lists.llvm.org
Fri Jan 17 09:37:19 PST 2025
================
@@ -121,11 +121,12 @@ def InitPriorityDocs : Documentation {
In C++, the order in which global variables are initialized across translation
units is unspecified, unlike the ordering within a single translation unit. The
``init_priority`` attribute allows you to specify a relative ordering for the
-initialization of objects declared at namespace scope in C++. The priority is
-given as an integer constant expression between 101 and 65535 (inclusive).
-Priorities outside of that range are reserved for use by the implementation. A
-lower value indicates a higher priority of initialization. Note that only the
-relative ordering of values is important. For example:
+initialization of objects declared at namespace scope in C++, even between translation
+units (but within a single final linked image). The priority is given as an integer
----------------
cachemeifyoucan wrote:
>From my understanding from the windows document, I don't think that work across the DLLs (meaning grouping the init from the same priority group from different DLL together). Updates LGTM.
https://github.com/llvm/llvm-project/pull/123098
More information about the cfe-commits
mailing list