Skip to content
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

Fix /W4 level warnings in MSVC++ 2015 #41

Merged
merged 4 commits into from
Jul 2, 2017
Merged

Conversation

Falconne
Copy link
Contributor

Remove unused variable names and use underlying class for enum (VS 2012 and above support strongly typed enums and will warn about incorrect usage).

Remove unused variable names and use underlying class for enum (VS 2012 and above support strongly typed enums and will warn about incorrect usage).
enum.h Outdated
@@ -349,7 +351,7 @@ BETTER_ENUMS_CONSTEXPR_ static T* _or_null(optional<T*> maybe)

template <typename T, typename U>
BETTER_ENUMS_CONSTEXPR_ U
continue_with(T ignored BETTER_ENUMS_UNUSED, U value) { return value; }
continue_with(T BETTER_ENUMS_UNUSED_WRAPPER(ignored) BETTER_ENUMS_UNUSED, U value) { return value; }
Copy link

@Jarod42 Jarod42 Jun 29, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not simply remove completely the parameter name:

 continue_with(T, U value) { return value; }

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternative PR is welcome. I didn't merge this mainly because of lack of time to port this PR to clang (see Travis failures), easy as that should be :/

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or perhaps we should first wait for @Falconne to respond/amend :)

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should probably apologize; I intended to do the port myself real quick, and then merge, which is why I didn't leave a comment about that. But then, I got a ton of work to do elsewhere, and neglected to update that I don't have the time anymore, for now...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't realise there was a failure in the clang build, I have pushed a fix that should hopefully address that.

I hadn't removed the unused variable because I thought there was a reason it was left there to begin with; I thought maybe GCC needed it. Was there a reason the BETTER_ENUMS_UNUSED macro was created in the first place instead of the variables simply being omitted?

Anyway, I've also removed the unused variable name in the commit and pushed that as well, I'll see how the build goes. Should I remove the used variable definition in the operator overload below as well?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC, I simply forgot about the option of not giving names. I welcome removing all such instances and the ..._UNUSED macro, it sounds like a strict improvement.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I screwed up the MSC_VER check in the last push, hence the new build errors. I'll fix that later today and do another push. I'll remove the unused variable in the operator overload too.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem; there is no rush. Obviously, I wasn't rushing (sorry), so it's only fair if you take your time :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I have it right now, but two of the Travis builds are failing due to what seems to be environmental issues on the build agent. I'm not sure what to do about that.

@aantron
Copy link
Owner

aantron commented Jul 1, 2017 via email

@aantron
Copy link
Owner

aantron commented Jul 1, 2017

Ok, looking better now :) I want to squash-merge this PR. The commit message will be the same as in the first commit (but GitHub will add the PR number to it). If that's okay with you, you don't have to do anything more – thanks!

@Falconne
Copy link
Contributor Author

Falconne commented Jul 2, 2017

Yep. I didn't do it myself because I didn't know if it would affect the pull request. So yeah, squash it when you merge.

@aantron aantron merged commit 6988e05 into aantron:master Jul 2, 2017
@aantron
Copy link
Owner

aantron commented Jul 2, 2017

No worries. I actually prefer this way (now that GitHub supports it after years of requesting :)). We get to keep the actual history of work in this PR, while master gets a more legible history of what was produced, and a reference to here.

I check to make sure it's okay with you, since I'm doing something with sentences that you wrote :)

Thanks for taking care of this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants