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
sci-physics/reduze: Fix building with GCC-6 #4796
Conversation
Bug: https://bugs.gentoo.org/show_bug.cgi?id=594900 Package-Manager: Portage-2.3.6, Repoman-2.3.2
ex resultLeadingNc = result; | ||
for (exset::const_iterator it = found.begin(); it != found.end(); ++it) { | ||
- VERIFY(is_a<function>(*it) && ex_to<function>(*it).get_name() == "Color"); | ||
+ VERIFY(is_a<GiNaC::function>(*it) && ex_to<GiNaC::function>(*it).get_name() == "Color"); |
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.
This change is already in reduze-2.1.
Pull Request assignment Areas affected: ebuilds sci-physics/reduze: |
😞 The QA check for this pull request has found the following issues: Issues inherited from Gentoo (may be modified by PR): |
get_filename_sectormappings(m.integralfamily()->name()); | ||
ofstream file(file_name.c_str()); | ||
if (!file) | ||
- ABORT("Can't write to " << file); |
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.
In C++98, streaming a stream object would have the effect of casting it to a void *
and streaming its address (or NULL
address if the failbit was set). This was omitted in C++11. IMHO, he best practice for debugging purposes is to stream the name of the file instead ("Can't write to test.txt" instead of "Can't write to 0x000000000000").
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.
or just addressof it?
ABORT("Can't write to " << &file_name);
bool is_readable_file(const string& filename) { | ||
ifstream is(filename.c_str()); | ||
- bool ok = is; | ||
+ bool ok = !is.fail(); |
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.
Again, is
would be casted to void *
and then to bool
in C++98. !is.fail()
has the same effect and is dialect neutral.
for (Iterator n = z_node.begin(); n != z_node.end(); ++n) | ||
for (Iterator s = n.second().begin(); s != n.second().end(); ++s) | ||
- m.zero_sectors_.insert(*s); | ||
+ m.zero_sectors_.insert((const int) *s); |
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.
This calls std::set::insert()
on YAML::Node::operator int() const but in C++11/14 it seems to cause an ambiguity between insert( const value_type& value )
, insert( value_type&& value )
, and insert( std::initializer_list<value_type> ilist )
. Explicitly casting it to const int
works to overcome this and is dialect neutral.
Bug: https://bugs.gentoo.org/show_bug.cgi?id=594900
Package-Manager: Portage-2.3.6, Repoman-2.3.2
No place for bug submissions or PRs upstream.
Note: Both ebuilds fail when built against 'sci-mathematics/ginac-1.7.2'. This is an unrelated bug.