-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Crank up static analysis audit #2607
Conversation
…peReader to use std::array so we can use .at and move some pointers to iterators.
…licy. Also reinstitute C6001 and C6011 because they're not actually a part of the 'core checks' and they're goodness we had before I turned them off at the beginning of this series.
…ouldn't need to, internal methods only.
…k for null as a defense against a bad QI implementation.
…essary span refs).
{ | ||
_RedrawCursor(); | ||
_cPosition.X = (SHORT)NewX; | ||
_cPosition.X = gsl::narrow<SHORT>(NewX); |
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.
this is marked noexcept but i thought narrow was the throwing one
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.
Urgh, it's actually weird and I should probably undo the one I just did earlier. gsl::narrow
would have been detected by the static analysis as throwing and it would have errored out if it was a problem.
The trick is that I believe the implementation of narrow
causes a Fail Fast and isn't actually throwing anything. Since that's not going to come back or in any way continue, it isn't technically violating the noexcept
marking...
{ | ||
return static_cast<UINT>(_storage.size()); | ||
return gsl::narrow<UINT>(_storage.size()); |
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.
(same as above)
// Routine Description: | ||
// - Constructs an instance of the CodepointWidthDetector class | ||
CodepointWidthDetector::CodepointWidthDetector() noexcept : | ||
_fallbackCache{}, |
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.
both of these should automatically get default-constructed for us, and we should be able to default our constructor.
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.
I think I did that and it carped so I did this.
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.
Yea this seems good to me. I have some minor notes, feel free to fix if you want.
…an extraneous local.
Summary of the Pull Request
Brings audit mode up to full warning speed and fixes relevant errors in the four active projects.
PR Checklist
Detailed Description of the Pull Request / Additional comments