On 07 Dec 2013, at 12:00, [email protected] wrote:

> From: Thiago Macieira <[email protected]>
> Subject: Re: [Development] [Request] Compiler warnings in Qt
> Date: 6 Dec 2013 18:16:20 GMT+1
> To: [email protected]
> 
> 
> 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.

_______________________________________________
Development mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/development

Reply via email to