-
Notifications
You must be signed in to change notification settings - Fork 89
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} Building with /W4 results in warning C4127 #17
Comments
There are a couple of places where this is the case, I think, not just line 904. I think disabling the warning for the whole file is acceptable. I'll fix it shortly. |
👍 I found another solution in case you want another option. You can assign to a var and then check it like this (from my own code): // Assign to var to avoid MSVC warning
// This section can be simplified in C++17 using a "constexpr if".
constexpr bool cSizeCheck = ( sizeof( size_t ) >= sizeof( int64_t ) );
if ( cSizeCheck )
... MSVC only complains if it's in the conditional expression. Thanks Daniel! |
Decided to go with the MSVC should be smart enough to optimize out the branches that are not invoked. In any case, issue closed. |
Ah right. Could use Anyways - thanks for the great lib! |
Right above line 904, an MSVC warning is explicitly disabled. I wonder if the same should be done here?
Happy to create a PR if so.
Workaround is to disable it for the entire include:
The text was updated successfully, but these errors were encountered: