createrepo_c
createrepo_c copied to clipboard
Use of reserved C++ keyword
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
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