Results 1 to 2 of 2

Thread: type qualifiers ignored

  1. #1
    Join Date
    Feb 2016
    Posts
    21
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default type qualifiers ignored

    Hi

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

    response.data is unsigned char

    Qt Code:
    1. Response response = signHash(pin, hash);
    2.  
    3. for (uint i = 0; i < response.length; i++)
    4. ba[i] = (const char)response.data[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
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    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, 16:31
  2. Replies: 1
    Last Post: 16th August 2013, 15:43
  3. Replies: 2
    Last Post: 22nd June 2010, 22:35
  4. const QStringList discards qualifiers
    By kandalf in forum Qt Programming
    Replies: 2
    Last Post: 25th January 2009, 19:09
  5. Access Specifiers, Modifiers and Qualifiers
    By sunil.thaha in forum General Programming
    Replies: 4
    Last Post: 8th March 2006, 13:07

Bookmarks

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.