-
Notifications
You must be signed in to change notification settings - Fork 16
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
Fix C++11 deprecation warnings #94
Conversation
Not sure what @BenKaufmann will say to this. Currently, clasp still compiles using C++98 if build without threads. The patch makes it incompatible. Another easy route would be to simply spell out the operators. A quick grep shows that there are further occurrences of With C++11, one can also remove the whole std::mem_fun business and use lambda's. |
Oh, I thought this was C++11... Shouldn't CMake set the C++ standard to 98 then? Ah, I see C++11 is only conditionally required... Probably got confused because clingo is setting a newer C++ standard 🙃 |
@haampie Thank you for the PR. I understand and appreciate the motivation. However, I disagree with the concrete change set. As @rkaminsk mentioned, clasp is still a C++98 code base at its core. C++11 is only required when building clasp with multi-threading enabled. This requirement was added in clasp 3.3.0 since it allowed us to drop the dependency to Intel's TBB library. No other modernization happened at this point though. In general, the plan for the future is to modernize clasp - but this should be a strategic/holistic change targeting at least C++17 or 20. It should also be tied to a new major version. For now, I would suggest to:
I created a corresponding branch and with these changes, I could build both clasp and clingo without the deprecation warnings. Please let me know whether this would also work for you. Finally, please observe that all development happens in the "dev" branch and therefore PRs should be opened against this branch. |
@BenKaufmann what about replacing std::mem_fun with explicit operators. Sure it's a little more verbose but we have a problem here because std::mem_fun is going to be removed. Like this it would continue to compile nicely with newer compilers (that no longer support C++98/not sure if there are/will be any). |
@rkaminsk I'm not sure I understand your concern here. Yes, compilers are allowed to remove EDIT: Ah, sorry. Missed your edit. |
I'm happy with @BenKaufmann's suggestions, my goal was to get rid of the noisy warnings but I missed that clasp and clingo have a different minimal c++ standard. Feel free to close 🙃 |
I am fine with your update. Let's keep it like this. Compiler developers are typically very conservative anyway. It's just that I personally would have chosen to make the code "forward" compatible. |
Ok, I'll look into that. For now, I close this PR with my changes merged to dev. |
No description provided.