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

resolve MSVC C4456 and C4459 #2511

Merged
merged 4 commits into from Jul 16, 2020
Merged

Conversation

olgavrou
Copy link
Collaborator

This PR resolves MSVC warnings related to local variables hiding other local or global variables with the same variable name.

Also resolves 3 small warnings related to parentheses, using a deprecated method, and using the wrong int type as index.

The CI should not display any more VW related warnings. However compiling with VS2019 I get more warnings locally so will work towards resolving those too.

@@ -3018,7 +3020,7 @@ action search::predictLDF(example* ecs, size_t ec_cnt, ptag mytag, const action*
// action "1" is at index 0. Map action to its appropriate index. In particular, this fixes an
// issue where the predicted action is the last, and there is no example header, causing an index
// beyond the end of the array (usually resulting in a segfault at some point.)
size_t action_index = a - COST_SENSITIVE::ec_is_example_header(ecs[0]) ? 0 : 1;
size_t action_index = (a - COST_SENSITIVE::ec_is_example_header(ecs[0])) ? 0 : 1;
Copy link
Member

Choose a reason for hiding this comment

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

So I think semantically it is meant to be the other way
a - (COST_SENSITIVE::ec_is_example_header(ecs[0]) ? 0 : 1);

But when done like that there are issues. @lokitoth is looking into this is it may be the cause for some other issues in Search.

I am no opposed to fixing the warning, since @lokitoth is working on the real fix too.

#2374
#2175

explore/explore_internal.h Outdated Show resolved Hide resolved
@olgavrou olgavrou merged commit 895d347 into VowpalWabbit:master Jul 16, 2020
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.

None yet

2 participants