[Interest] Need argumentative help..... giving qobject copy/assignment constructor and put it in qlist/qmap

Scott Aron Bloom scott at towel42.com
Wed Jul 22 20:42:55 CEST 2015


-----Original Message-----
From: interest-bounces+scott=towel42.com at qt-project.org [mailto:interest-bounces+scott=towel42.com at qt-project.org] On Behalf Of Matthew Woehlke
Sent: Wednesday, July 22, 2015 11:40 AM
To: interest at qt-project.org
Subject: Re: [Interest] Need argumentative help..... giving qobject copy/assignment constructor and put it in qlist/qmap

On 2015-07-21 19:39, Thiago Macieira wrote:
> On Tuesday 21 July 2015 21:18:35 Jason H wrote:
>> Once I was put in charge of a project where an "engineer" had 
>> replaced
>> (inherited) all the Qt Q* classes used in the project to classes that 
>> did not have a 'Q' as a first letter. No other changes. And yes, that 
>> "engineer" was a contractor.
> 
> Is that better or worse than the "engineer" who added const to all 
> return types that were already rvalues?

-Werror=ignored-qualifiers ;-)

...and yes, I regularly build with this. I strongly encourage doing so; I ran into a library (I won't name names, but it is an open source library that is well known for its purpose) that thoroughly botched the const correctness on their C bindings because someone didn't realize that 'const PTYPE' != 'TYPE const*' (for 'typedef TYPE* PTYPE').

(On that subject, -Werror=cast-qual also might have helped here; that's another one I use and would encourage. Also -Werror=return-type, which
*EVERYONE* should use, period.)

--
While I 100% agree, one thing I really cant stand, is when 3rd party vendors, DISABLE WARNINGS in their code, and don't re-enable them when their code exits (Im looking at you Qt).

Im not a g++ guru, but in VC++ #pragma( push) and #pragma( pop ) should be a requirement for all 3rd party headers that disable warnings.

Off my soapbox now

Scott



More information about the Interest mailing list