Casting const void* const to const char* const produces the "ignored-qualifiers" warning, why?
I don’t understand why the following code gives the "type qualifiers ignored on cast result type" warning in GCC, can you please explain? #include <stdint.h> char f(const void* const a) noexcept { return static_cast<char>(*static_cast<const char* const>(a)); } https://godbolt.org/z/n8Ws9aTcq >Solution : A non-class non-array prvalue cannot be cv-qualified. This means that your static_cast<const char* const>(a) is… Read More Casting const void* const to const char* const produces the "ignored-qualifiers" warning, why?