Results 1 to 2 of 2

Thread: type qualifiers ignored

  1. #1
    Join Date
    Feb 2016
    Qt products

    Default type qualifiers ignored


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

    Qt Code:
    1. Response response = signHash(pin, hash);
    3. for (uint i = 0; i < response.length; i++)
    4. ba[i] = (const char)[i];
    To copy to clipboard, switch view to plain text mode 

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

    lg Chris

  2. #2
    Join Date
    Sep 2009
    Wroclaw, Poland
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    MacOS X Unix/X11 Windows Android

    Default Re: type qualifiers ignored

    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.

Similar Threads

  1. Replies: 2
    Last Post: 30th September 2015, 15:31
  2. Replies: 1
    Last Post: 16th August 2013, 14:43
  3. Replies: 2
    Last Post: 22nd June 2010, 21:35
  4. const QStringList discards qualifiers
    By kandalf in forum Qt Programming
    Replies: 2
    Last Post: 25th January 2009, 18:09
  5. Access Specifiers, Modifiers and Qualifiers
    By sunil.thaha in forum General Programming
    Replies: 4
    Last Post: 8th March 2006, 12:07


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.