-
Notifications
You must be signed in to change notification settings - Fork 329
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
MSVC: Treat warnings as errors #2619
base: main
Are you sure you want to change the base?
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.
@chrisdembia Most of these are due to mixing int and size_t, can we use size_t instead of casting whenever possible? Thanks
A while ago, I was trying to figure out the best way to handle the different integer types in loops, and my first thought was to use So, using I also referred to the C++ Core Guidelines: https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#es107-dont-use-unsigned-for-subscripts-prefer-gslindex. These guidelines suggest using a different type from a third-party library
They suggest sticking to signed integers. I know that |
@@ -28,3 +29,5 @@ dependencies/* | |||
# MAC File System files | |||
.DS_Store | |||
|
|||
/CMakeSettings.json | |||
|
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.
Are these changes related?
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.
Reviewed 15 of 15 files at r1.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @chrisdembia)
Brief summary of changes
This PR causes MSVC to treat warnings as errors and checks an additional warning about signed/unsigned integers for consistency with warnings generated by Clang.
I'm making this change to help with a similar change in Moco.
Testing I've completed
Ran all ctests.
CHANGELOG.md (choose one)
This change is