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

sci-physics/reduze: Fix building with GCC-6 #4796

Closed
wants to merge 1 commit into from

Conversation

Peter-Levine
Copy link
Contributor

@Peter-Levine Peter-Levine commented May 28, 2017

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.

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");
Copy link
Contributor Author

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.

@gentoo-repo-qa-bot gentoo-repo-qa-bot added the assigned PR successfully assigned to the package maintainer(s). label May 28, 2017
@gentoo-repo-qa-bot
Copy link
Collaborator

Pull Request assignment

Areas affected: ebuilds
Packages affected: sci-physics/reduze

sci-physics/reduze: grozin, @gentoo/sci-physics

get_filename_sectormappings(m.integralfamily()->name());
ofstream file(file_name.c_str());
if (!file)
- ABORT("Can't write to " << file);
Copy link
Contributor Author

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").

Copy link
Member

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();
Copy link
Contributor Author

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);
Copy link
Contributor Author

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.

@gentoo-bot gentoo-bot closed this in 8aeb28a Jun 2, 2017
@Peter-Levine Peter-Levine deleted the bug-594900 branch June 3, 2017 00:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
assigned PR successfully assigned to the package maintainer(s).
Projects
None yet
3 participants