PDA

View Full Version : type qualifiers ignored



ckvsoft
15th December 2018, 13:21
Hi

I got a "Warnung: type qualifiers ignored on cast result type [-Wignored-qualifiers]"

response.data is unsigned char


QByteArray ba;
Response response = signHash(pin, hash);

for (uint i = 0; i < response.length; i++)
ba[i] = (const char)response.data[i];


Can i simply remove "(const char)" for same result?

lg Chris

stampede
21st December 2018, 18:56
Yes. The thing is that the `const` part in the cast is superfluous. If the `data[i]` us `unsigned char` then you can simply remove the cast altogether.