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

ignored type qualifiers #247

Open
graetz23 opened this issue Oct 28, 2024 · 0 comments
Open

ignored type qualifiers #247

graetz23 opened this issue Oct 28, 2024 · 0 comments

Comments

@graetz23
Copy link

Hi there,

having this in cloned Makefile:

make[1]: Entering directory '/home/chris/source/assembler/x64asm'
ccache g++ -Werror -Wextra -Wall -Wfatal-errors -pedantic -Wno-unused-parameter -Wno-reorder -Wignored-qualifiers -std=c++11 -fPIC -DNDEBUG -O3 -I./ -c src/r.cc -o src/r.o
src/r.cc: In member function ‘std::ostream& x64asm::R::write_att(std::ostream&) const’:
src/r.cc:221:12: error: type qualifiers ignored on cast result type [-Werror=ignored-qualifiers]
  221 |     return static_cast<const Rh* const>(this)->write_att(os);
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated due to -Wfatal-errors.

solving it by adding to Makefile ignore warning:

GCC=ccache .. -Wno-ignored-qualifiers ..

However, I think the const at:

case Type::RH:
  return static_cast<const R* const>(this)->write_att(os);
  break:

is not necessary, like:

case Type::RH:
  return static_cast<const R*>(this)->write_att(os);
  break:

and, therefore, may add some pull request.

best
Christian

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