Results 1 to 4 of 4

Thread: Compiler Warning Settings

  1. #1
    Join Date
    Jun 2011
    Posts
    203
    Thanks
    7
    Thanked 4 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Compiler Warning Settings

    Where do I change/select the compiler warning settings/options?

  2. #2
    Join Date
    Jul 2008
    Location
    Germany
    Posts
    503
    Thanks
    11
    Thanked 76 Times in 74 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Compiler Warning Settings

    Hi, which IDE do you use?

    Ginsengelf

  3. #3
    Join Date
    Jun 2011
    Posts
    203
    Thanks
    7
    Thanked 4 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Compiler Warning Settings

    Qt Creator 2.2.0 and 4.13.3.

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Compiler Warning Settings

    You can extend the default warning set in a platform-independent way but adding this to your PRO file:
    Qt Code:
    1. CONFIG += warn_on
    To copy to clipboard, switch view to plain text mode 
    and suppress the vast majority (not recommended):
    Qt Code:
    1. CONFIG += warn_off
    To copy to clipboard, switch view to plain text mode 
    If you need something unusual then you can add options to QMAKE_CFLAGS and QMAKE_CXXFLAGS. Since these will be compiler specific you should make them scope specific, for example:
    Qt Code:
    1. win32-msvc {
    2. QMAKE_CFLAGS += /blah
    3. QMAKE_CXX_FLAGS == /blah
    4. }
    5. win32-g++ {
    6. QMAKE_CFLAGS += --blah
    7. QMAKE_CXX_FLAGS == --blah
    8. }
    To copy to clipboard, switch view to plain text mode 

  5. The following 2 users say thank you to ChrisW67 for this useful post:

    Atomic_Sheep (15th March 2021), d_stranz (11th March 2021)

Similar Threads

  1. Strange compiler behaviour (compiler passes wrong argument)
    By SasaVilic in forum General Programming
    Replies: 2
    Last Post: 2nd November 2010, 12:36
  2. Qt for S60, compiler warning regarding TRUE/FALSE
    By Archimedes in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 22nd October 2009, 15:09
  3. Useless but curious compiler warning question
    By Raccoon29 in forum General Programming
    Replies: 4
    Last Post: 30th July 2008, 21:46
  4. default argument compiler warning
    By TheKedge in forum Qt Programming
    Replies: 1
    Last Post: 27th March 2007, 15:57
  5. Compiling custom Qt3 Widgets Gives warning in VC++6 Compiler
    By sunil.thaha in forum Qt Programming
    Replies: 4
    Last Post: 9th June 2006, 13:44

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.