[Development] Enabling -Werror developer builds

Frederik Gladhorn frederik.gladhorn at digia.com
Tue Aug 20 16:23:53 CEST 2013


Mandag 19. august 2013 15.14.03 skrev Thiago Macieira:
> Hello
> 
> Commit ebfd85a499a4382ace09d443b1f35cd6b1848af6 adds support for -Werror,
> but it hasn't been acted on yet. The commit says:
> 
>     This is enabled only for -developer-builds and only for certain
>     compiler-version combinations that are in a whitelist.
> 
>     It also requires each library, plugin or tool to declare whether it is
>     supposedly clean of warnings. When most targets are clean, we can
>     consider inverting.
> 
> So, expanding:
> 1) -Werror is opt-in for regular builds (pass -warnings-are-errors to
> configure), and opt-out for developer builds (pass -no-warnings-are-errors).
> 
> 2) -Werror is enabled only for certain compiler versions. I'll update the
> whitelist to have an upper range too. For example, right now it enables -
> Werror for GCC 4.6 and above. I'm going to introduce an upper limit because
> we don't know what new warnings our code triggers with newer versions of
> GCC. That means we'll need to first clean up the warnings before expanding
> the whitelist.
> 
> 3) Each library, plugin or tool needs to declare it's clean by passing:
> 	CONFIG += warning_clean
> or possibly:
> 	*-g++*:CONFIG += warning_clean
> 
> Right now, I've got most modules compiling with -Werror with GCC 4.7. I'd
> like to start adding the CONFIG to enable the flag.
> 
> Objections?

I like the idea and the approach is conservative in that it works by white-
listing newer compilers.

+1 from me for enabling it for the added compilers and setting the upper 
limit.

-- 
Best regards,
Frederik Gladhorn
Senior Software Engineer - Digia, Qt
Visit us on: http://qt.digia.com




More information about the Development mailing list