-
Notifications
You must be signed in to change notification settings - Fork 6
Compile with /W3 on Windows #45
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
Conversation
Enable /WX (treat warnings as errors). Fix some basic errors that were found. Enable /FC (emit full path on diagnostics) to make it easier for IDE. Add (commented out) entries for enabling debug builds for dev.
|
Troubling... Check failed on Windows but it succeeded locally. Will investigate. |
|
Updated local env to Python 3.9 to uncover new UNICODE deprecation warnings, which now trigger errors due to /WX! |
src/SharedMemory.cpp
Outdated
| { | ||
| return -(S_FALSE); | ||
| } | ||
| //UNUSED? if (!CheckWindowsSharedMemoryPrerequisites(pMappingName)) |
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.
Why are you considering the CheckWindowsSharedMemoryPrerequisites() function call as unused here?
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.
Because in this UtilMappedViewReadBegin() the pMappingName is uninitialized, checked and subsequently unused. Likely the result of large copy+paste. I don't quite know where this is used, if it is, so I opted for the loud, ugly commenting-out style of remediation.
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.
In this case, it looks like the check is just happening in the wrong place; it looks like L567 is probably a better place for it (just prior to when the shared-memory mapping is created). If the check fails, you'd also need to dispose the allocated file handle before returning -(S_FALSE). The purpose of the check is to better handle the case where the user doesn't have permissions to create the shared-memory mapping -- so we can provide a reasonable error message to the user; otherwise, the call just fails and it's very non-obvious to the end-user why it happened.
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 thought so too, until I saw on line 578 that pMappingName is unused. Hence none of this is necessary.
I don't know offhand if pMappingName should be used, in which case I would unwind all this UNUSED? nonsense and complete the implementation properly.
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 created a new issue for implementing this and will keep the code commented out so it's safe.
Enable /WX (treat warnings as errors).
Fix some basic errors that were found.
Enable /FC (emit full path on diagnostics) to make it easier for IDE.
Add (commented out) entries for enabling debug builds for dev.