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

Use of reserved C++ keyword #181

Open
Taronyu opened this issue Oct 23, 2019 · 1 comment
Open

Use of reserved C++ keyword #181

Taronyu opened this issue Oct 23, 2019 · 1 comment

Comments

@Taronyu
Copy link

Taronyu commented Oct 23, 2019

In package.h the package struct contains the line GSList *requires. Since C++20 "requires" is a reserved keyword, so clang++ is complaining about it and terminates compilation of my code. I am using clang version 8.0.0 with the --std=c++2a flag. Using g++ does not lead to errors (version 9.1.0).

Since this is code that is accessible to clients of createrepo_c, changing the variable's name is probably not much of an option because of the amount of code that might break. Any tips how I can solve this?

Edit: As a quick fix I switched to using C++17

@lukash
Copy link
Contributor

lukash commented Oct 29, 2019

FWIW you may be able to work around it using some tricks described here: https://stackoverflow.com/questions/36867325/how-to-link-old-c-code-with-reserved-keywords-in-it-with-c

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

No branches or pull requests

2 participants