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

Duplicate const specifier #5

Open
DanRStevens opened this issue Oct 26, 2020 · 1 comment
Open

Duplicate const specifier #5

DanRStevens opened this issue Oct 26, 2020 · 1 comment

Comments

@DanRStevens
Copy link
Contributor

When building on Ubuntu 20.04, with #2 and #3 applied, build fails with:

error: duplicate 'const' declaration specifier [-Werror,-Wduplicate-decl-specifier]

I believe this comes from src/libxlibtrace-print.h, where the parameter __REALTYPE__(safetype) const * value is used in several places. If __REALTYPE__(safetype) is not a pointer type, this can result in both east-const and west-const being specified, resulting in a duplicate specifier.

Unfortunately removing const from the parameter seems to cause other problems. I suspect this is due to pointer types, where the different positions for const would cause one to be applied to the pointer itself, rather than the pointed to type.


This is distinct from the change in #3.

@DanRStevens
Copy link
Contributor Author

I re-tested this. It seems the code builds fine on Ubnutu 20.04 using GCC, but fails with the above error using Clang. During my previous test, I had an environment variable set that caused the build to use Clang.

export CC=clang  # Was set in my environment, leading to error

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

1 participant