-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Bugfix: grpc supress incorrect warning #8669
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
@aardappel should be easy to merge, maybe there would be a way to rewrite this to be simpler for humans and compiler but it wasn't clear to me how |
It doesn't seem so great to be putting compiler specific warning toggles in the code like this. What is the exact error? Can it be fixed in different ways, for example to construct the slice directly in |
new_p is a local addr but is owned now by slice_ thus the life time does not end at the end of the function
7df8dd6
to
42132ee
Compare
The error/warning message with GCC 14.3 is:
I updated the MR to return the pointer to the _slice.begin() which should be the same as new_p and allowing the compiler to understand that the address is not out of scope |
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.
Hmm this seems strange that this is required for the compiler, but I guess we'll merge for now.
Thanks, I assume at some point diagnostics will become better but for now i guess the compiler sees the pointer and new_slice and both are going out of scope and it misses the fact that this memory is now owned by |
Sorry was reading from the phone and miss clicked |
@aardappel i don't think any failed CI jobs are related to this change? |
new_p is a local addr but is owned now by slice_
thus the life time does not end at the end of the function
The newest compilers had opinions about returning
new_p
here.