[PATCH] D31413: [libc++] Use __attribute__((init_priority(101))) to ensure streams get initialized early
Aaron Ballman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Mar 28 04:57:10 PDT 2017
aaron.ballman added a comment.
I'm not certain of a good way to test it, but I have a question about the value you picked for `init_priority`. My understanding of the values starting from 101 is that 1-100 are reserved for implementation use. Is that understanding correct? If so, you may want to pick a value below 100 to ensure there's not an arms race with the user. I believe this may require some alteration to SemaDeclAttr.cpp to not diagnose when this is coming from a system header. Otherwise, what's to stop the user from having something marked `constructor(101)` that attempts to use a stream, but can't because they're not initialized yet?
https://reviews.llvm.org/D31413
More information about the cfe-commits
mailing list