[Development] [Request] Compiler warnings in Qt

Kurt Pattyn pattyn.kurt at gmail.com
Sat Dec 7 13:36:35 CET 2013


On 07 Dec 2013, at 12:00, development-request at qt-project.org wrote:

> From: Thiago Macieira <thiago.macieira at intel.com>
> Subject: Re: [Development] [Request] Compiler warnings in Qt
> Date: 6 Dec 2013 18:16:20 GMT+1
> To: development at qt-project.org
> 
> 
> On sexta-feira, 6 de dezembro de 2013 11:16:20, Kurt Pattyn wrote:
>> When compiling applications with compiler flags on, a lot of warnings are
>> generated for the Qt header files. I
> 
> Which compiler? Which warnings?

Both with Clang on OSX and GCC on Linux and Windows (MinGW).
These are the flags that are used:
                        "-std=c++11"
                        "-Wall"
                        "-Wpedantic"
                        "-Wextra"
                        "-Weffc++"                  #turn on warnings from Effective C++ handbook
                        "-fno-rtti"                 	   #disable runtime type information
                        "-ffor-scope"
                        "-fuse-cxa-atexit"
                        "-fno-default-inline"
                        "-fvisibility=hidden"       #do not export symbols by default
                        "-fvisibility-inlines-hidden"
                        "-pedantic-errors"
                        "-Wsign-conversion"
                        "-Wsign-promo"
                        "-Wsign-compare"
                        "-Wnon-virtual-dtor"
                        "-Wold-style-cast"
                        "-Woverloaded-virtual"
                        "-Wzero-as-null-pointer-constant"
                        "-Wswitch"
                        "-Wswitch-default"
                        "-Wswitch-enum"
                        "-Wcast-qual"
                        "-Wcast-align"
                        "-Wuninitialized"
                        "-Wfloat-equal"
#                        "-Wshadow"                 #disable warning as too many false negatives are created
                        "-Wuseless-cast"
                        "-Wlogical-op"
                        "-Wpacked"
                        "-Wredundant-decls"
                        "-Winline"
                        "-Wdisabled-optimization"
                        "-Wdeprecated"
                        "-Wempty-body"
                        "-Wreturn-type"
                        "-Wunused-variable"
                        "-Wformat"
                        "-Wformat-nonliteral"
                        "-Wunreachable-code"

For Clang these are comparable.

The kind of warnings are mostly signed/unsigned conversions (mainly caused by QFlags). There is a non-virtual destructor warning on QSharedData (-Weffc++).
The moc generated files, generate errors like missing default clause in switch statement.
Do you want a complete list?

> 
> We're not supposed to have any warnings with GCC or Clang.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20131207/4a418709/attachment.html>


More information about the Development mailing list