-
Notifications
You must be signed in to change notification settings - Fork 15.6k
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
"Fixed" Visual Studio constinit errors #10232
Conversation
…pilers under c+17 and c+20 standards
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
I would really like this issue was closed finally, as it is present for years and rises again and again. Why somebody without clue, why there is msc_ver ifdef, removes it, and commits ab4585a#diff-c6c960709f2bebcb680ec27d5b8c61777bcfa7081e00229e22b0fe9fc3226ee5. |
We need you to agree to the cla and reply with "I signed it" to trigger the recheck before we can accept this |
as for the re-rising, I am sorry about that. It got erased by one of our scripts that tries to synchronize the internal and external versions of protobuf. We have a major project ongoing to fix these and reduce the delta between them, so hopefully we will be able to finally put it to bed for good |
I pushed it under my company email, instead of private one. How can I proceed with CLA? I cannot sign other CLA;-( |
I kicked the script and it recognizes a CLA for you now, so we are good on that front. I will merge after the pending tests pass (usually takes ~2-3h) |
Great! |
I still have this problem in visual studio (17.0) with the latest vcpkg and protobuf 3.21. |
Either apply patch manually to your vcpkg version, or make protobuf port patch request to vcpkg. |
We have an upcoming 21.x release which will include this |
ok, thanks |
Note this doesn't actually fix the constinit issue. It merely suppresses a compile error that was flagging a real bug in protobuf. Protobuf's constant initialization design was predicated on a bunch of patterns being constinit. MSVC and clang-cl are correct to flag it as not constinit because, on Windows, references to dllimport variables emit a static initializer. They are not actually constinit. See details in #10159. |
Fixes #9698 and #10159 for now. Replaces incorrect #10231 pull request.