Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt Build Warnings mute it

Qt Build Warnings mute it

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 4 Posters 939 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • replR Offline
    replR Offline
    repl
    wrote on last edited by
    #1

    while building my Qt code, It is showing so many warnings along with errors. How to stop and make to show only errors

    Also facing an error
    error: cast from 'void*' to 'long unsigned int' loses precision [-fpermissive]
    How to resolve it ?

    JonBJ jsulmJ 2 Replies Last reply
    0
    • replR repl

      while building my Qt code, It is showing so many warnings along with errors. How to stop and make to show only errors

      Also facing an error
      error: cast from 'void*' to 'long unsigned int' loses precision [-fpermissive]
      How to resolve it ?

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @repl
      I believe you are using gcc (or maybe mingw).

      To change to suppress warnings, you probably pass flag -Wall at present, maybe also -Wextra. Removing these flag(s) would get rid of them. You could add -w to inhibit all warning messages. A complete list is shown at https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html

      To get rid of the "loses precision" error you need to pass -fpermissive flag. If you are doing that and you still get warning you might need to put into your/the offending code the line:
      #pragma GCC diagnostic ignored "-fpermissive"

      However in all these cases you would be best leaving warnings on and fix the actual code to be correct. There is a reason warnings are there....

      1 Reply Last reply
      2
      • Christian EhrlicherC Offline
        Christian EhrlicherC Offline
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on last edited by
        #3

        @repl said in Qt Build Warnings mute it:

        How to resolve it ?

        Fix your code.

        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
        Visit the Qt Academy at https://academy.qt.io/catalog

        1 Reply Last reply
        1
        • replR repl

          while building my Qt code, It is showing so many warnings along with errors. How to stop and make to show only errors

          Also facing an error
          error: cast from 'void*' to 'long unsigned int' loses precision [-fpermissive]
          How to resolve it ?

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @repl said in Qt Build Warnings mute it:

          long unsigned int

          this is 32bit. sizeof(void*) is 64bit on 64bit systems. So, you're trying to store a 64bit value in a 32bit variable...

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          4

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved