Skip to content
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

Maintain constness of accessed XmlRpcValue struct #2315

Open
wants to merge 1 commit into
base: noetic-devel
Choose a base branch
from

Conversation

rhaschke
Copy link
Contributor

@rhaschke rhaschke commented Feb 21, 2023

Return value should not change constness of this pointer!
This augments/completes #1978.

Return value should not change constness of this pointer!
Copy link
Contributor

@peci1 peci1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logically, this change makes sense. I'm a bit afraid there could be some downstream code depending on the old twisted logic, though. Not sure this would pass the API stability requirements.

I ran extensive test suite on my xmlrpcvalue wrapper and found no issues. But that's just one library.

@peci1
Copy link
Contributor

peci1 commented Apr 9, 2023

Just a note: The getter does not change constness of this->. It just returns one non-const value from the const struct (map-like) object. Yes, it seems silly, but the current API allows that. The constness is applied just to the internal pointer, not to the pointed-to value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants