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
    464
    Thanks
    10
    Thanked 61 Times in 59 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,728
    Thanks
    13
    Thanked 1,608 Times in 1,535 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, 11: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, 14:09
  3. Useless but curious compiler warning question
    By Raccoon29 in forum General Programming
    Replies: 4
    Last Post: 30th July 2008, 20:46
  4. default argument compiler warning
    By TheKedge in forum Qt Programming
    Replies: 1
    Last Post: 27th March 2007, 14: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, 12: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.