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 Windows build errors #47350
fix Windows build errors #47350
Conversation
…ventually calls std::abort())
This looks redundant to me: can we find a solution to make LOG(FATAL) work with MSVC? Either adding the abort more prominently there, or use an attribute or any annotation that would appease MSVC? Alternatively: can a flag be added to the MSVC configuration to disable this warning/error? |
Due to the fact that the LOG macro expands to a subclass of std::ostringstream, I don't see a way to place abort() anywhere else than in the destructor and at the same time keep the semantics of the LOG macro.
It's an error (I wouldn't have submitted this PR just to silence a false warning ;-) ), or rather it's tons of error C4716, for example:
|
In the documentation of the MSVC compiler, I only found switches to handle warnings (suppress them or raise them like errors), but not errors. Nevertheless, I gave it a try to see if the suppress warning switch would also suppress an error, and added the according switch
But it kept failing with the C4716 error. So, in the end I don't see any better solution than mine. |
The MSVC doc suggests using |
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.
As per previous comment to try using #pragma
.
I tried to build it with the suggested I updated the PR accordingly. |
fix some more build errors of the kind already addressed in #42676:
compiler doesn't get that LOG(FATAL) macro eventually calls std::abort() and complains with "method doesn't return a value", so call abort explicitely