[clang] [clang] Improve the documentation for the init_priority attribute (PR #123098)
Steven Wu via cfe-commits
cfe-commits at lists.llvm.org
Wed Jan 15 10:15:53 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:
I feel this reads better:
```
... declared at namespace scope in C++ with in a single linked image on supported platforms
```
I am unsure about how COFF support is, does that work across all .dlls? If Windows actually works across boundaries, this needs to be revised.
https://github.com/llvm/llvm-project/pull/123098
More information about the cfe-commits
mailing list