-
Notifications
You must be signed in to change notification settings - Fork 29
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
Create rule S7119: Global should not depend on possibly not yet initialized variables CPP-5655 #4387
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the past, I used the Nifty counter idiom to solve initialization order issues. I'm not sure how relevant it is today, but it might be useful for legacy code? Should it be mentioned?
I think just having a function that returns a reference is a better and simpler solution in that case; see |
Co-authored-by: Loïc Joly <[email protected]>
rules/S5421/cfamily/rule.adoc
Outdated
=== Articles & blog posts | ||
|
||
* Stack Overflow - Answer by Gabriel Staples for https://stackoverflow.com/a/73027793/24103368[What is the point of declaring "const volatile int *p"?] | ||
* Stack Overflow - Answer by Gabriel les for https://stackoverflow.com/a/73027793/24103368[What is the point of declaring "const volatile int *p"?] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you change that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By pure accident, I will fix that. Thank you for caching it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved after a few typos are fixed
Co-authored-by: Loïc Joly <[email protected]>
Quality Gate passed for 'rspec-tools'Issues Measures |
Quality Gate passed for 'rspec-frontend'Issues Measures |
Quality Gate passed for 'rspec-frontend'Issues Measures |
Quality Gate passed for 'rspec-tools'Issues Measures |
You can preview this rule here (updated a few minutes after each push).
Review
A dedicated reviewer checked the rule description successfully for: