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 turning off important GCC / Clang warnings?

Qt turning off important GCC / Clang warnings?

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 719 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.
  • rkhaotixR Offline
    rkhaotixR Offline
    rkhaotix
    wrote on last edited by
    #1

    Hello people!

    In this last week I've discovered some annoying things about Qt and the project I'm working on for years. Days ago I received a pull request at GitHub that enables my project to be built in Visual Studio. I was very happy to see such improvements in action but as I started to explore the new code my nightmare began!

    I usually compile my project using GCC and Clang to check different warnings and errors. I fix all warnings that both compilers display as soon as possible. But when I tried the first time to compile the patched version of my project in Visual Studio the compiler started to spit out a lot of warnings related to integer casts that leads to possible data loss (for instance converting size_t to unsigned). I Googled a bit and discovered that -Wconversion and -Wshorten-64-to-32 are the options that enables such warnings and Qt does not bring them on in Linux, Windows (MingW) and MacOSX bundles. When I forced such warnings for my surprise and desperation a lot of Qt headers triggers them and my project's source too! :(

    Well, my project has ~90K lines of code and I'm not willing to fix those warnings for now (maybe never fix them!)... I tried twice and accidentally introduced bugs so I reverted back to the original code. My questions are: 1) Why does Qt disable such warnings? 2) Someone has some thoughts or words from framework developers?

    I know that implicit cast can be harmless in several scopes but what I can't understand is why disable the warnings!? :(

    Regards.

    P.S.: Sorry my bad English.

    1 Reply Last reply
    0
    • JKSHJ Offline
      JKSHJ Offline
      JKSH
      Moderators
      wrote on last edited by
      #2

      Hi @rkhaotix,

      I don't know the answer. However, I recommend that you subscribe to the Interest mailing list and post your question there. Qt engineers are active on that list, but they won't see your post in this forum.

      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

      1 Reply Last reply
      0

      • Login

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