-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
memory safety: audit use of static variables #11130
Comments
There is a clang-tidy rule that can check this. We tried it but then turned it off for some reason. @lizan knows the history here. |
/sub |
There is a check in clang-tidy: https://clang.llvm.org/extra/clang-tidy/checks/fuchsia-statically-constructed-objects.html The problem was tests are registered via static registration mechanism which will be flagged by clang-tidy. If we wrap those macro, i.e. |
This has caused enough problems lately that I think we should turn this check on and deal with the macros. @lizan wdyt? |
sounds reasonable. |
We should audit the use of static variables in the codebase to prevent static initialization/deinitialization order problems internally, and for dependent projects.
The codebase already defines a construct on first use macro. We should audit other static variables that should be migrated, and enforce the pattern via code linting.
The text was updated successfully, but these errors were encountered: