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

boost::logic::tribool requires explicit cast #140

Closed
wants to merge 1 commit into from
Closed

boost::logic::tribool requires explicit cast #140

wants to merge 1 commit into from

Conversation

AdamMajer
Copy link

Since Boost 1.69.0, tribool -> bool cast is explicit.
To minimize changes in Yast2 codebase, re-add this
cast explicitly to YCPBoolean

This should fix https://bugzilla.suse.com/show_bug.cgi?id=1128364

Since Boost 1.69.0, tribool -> bool cast is explicit.
To minimize changes in Yast2 codebase, re-add this
cast explicitly to YCPBoolean
@@ -98,6 +99,7 @@ class YCPBoolean : public YCPValue
static YCPBoolean* falseboolean;

public:
YCPBoolean(const boost::logic::tribool &tb) : YCPBoolean((bool)tb) {}
Copy link
Member

Choose a reason for hiding this comment

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

where is this tribool used? So far I see in core only usage of some trivial string algorithm from boost.

Copy link
Author

Choose a reason for hiding this comment

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

https://bugzilla.suse.com/show_bug.cgi?id=1128364

so the fixes is either to explicitly cast it there in every usage or provide this cast here.

Copy link
Member

Choose a reason for hiding this comment

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

@lslezak can you please check it? I am not sure if there is not some consequences for tribool to boolean conversion in some places in pkg-bindings.
also @mvidner if you can check it.

Copy link
Member

Choose a reason for hiding this comment

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

I am making a better fix in yast-pkg-bindings.

@mvidner
Copy link
Member

mvidner commented Mar 8, 2019

yast/yast-pkg-bindings#112 is IMHO a better fix for this because it is a specific fix for one usage of tribool in the libzypp API. Adding an implicit conversion to YCPBoolean would bite us in unexpected times. (Also, yast-core does not care about tribools anywhere else)
The build monitor of Staging:L shows that yast2-package-bindings.rpm was the only such failure in YaST.

@AdamMajer anyway, thanks for the bug report and for the PR!

@AdamMajer
Copy link
Author

Thank you for fixing this.

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.

None yet

3 participants