GridGraph icon indicating copy to clipboard operation
GridGraph copied to clipboard

Ubuntu 17 g++ 7.2 Compatible

Open Abddo9 opened this issue 6 years ago • 2 comments

This modification was made because the project was not compiling with Ubununtu 17 and g++ 7.2 this version should be backward compatible (I have tried also on Ubuntu 14.04.5 LTS with g++ 5.4.1) it was based on "*NIX compatibility by HippoBaro" pull request on the GridGraph repository, The modifications were to silence couple of warnings that are treated as errors in couple of files and preventing the project from compiling

to clone this pull request: git clone https://github.com/thu-pacman/GridGraph.git cd GridGraph git fetch origin pull/7/head git checkout -b pullrequest FETCH_HEAD

to compile mkdir build cd build cmake .. make

Abddo9 avatar Apr 28 '18 05:04 Abddo9

Please squash your commits to discard the spurious additions/deletions to the patch.

It seems the only modifications you made was to declare return variables for various function calls. Seems to me like a bad way to solve the problem. Your standard library might have flagged those functions with warn_unused_result, which is a GCC attribute. Passing -Wno-unused-result to gcc will be a better way of handling that. IMO the variables that you introduced aren't useful as they are, because you just return in case of errors, resuming normal control flow.

As for merging this, I think you'd be better off just committing on my branch since the changes are minor and fix something that should have been in my commits (sorry for that! 🙄)

Anyway thanks for catching that, my GCC 7.3.1 on Fedora 27 didn't have that problem.

HippoBaro avatar Apr 28 '18 09:04 HippoBaro

Yeah, I just wanted to give (whoever wants to try this project) a version that compiles without having troupes to search and ask around about how to compile it, and I agree a better solution would have been to do a real check on the return value for errors and may be through an exception (by the way I am just doing a fake check to get it to compile). and for the number of changes, I think they look many because they are compared to the master branch, but when the owner merge your pull-request and compare again they should be less.

Abddo9 avatar Apr 30 '18 02:04 Abddo9