[Development] Two source incompatibilities in Qt 5.5 with Clang
Thiago Macieira
thiago.macieira at intel.com
Fri Mar 13 17:08:35 CET 2015
On Friday 13 March 2015 12:23:00 Stephen Kelly wrote:
> Thiago Macieira wrote:
> >> What macro works for multiple versions of Qt?
> >> Why should everyone define such a macro themselves in their code? How
> >> about contributing it back to qglobal.h? What would it be called? And to
> >> bring this full circle, how about swapping the semantic of the old and
> >> new macros?
> >>
> >> I'm sure you considered not making the SIC change and creating a new
> >> macro instead. Why did you decide for the SIC?
> >
> > Two main reasons:
> >
> > 1) it improves existing code, since we can get rid of some #ifdefs
> >
> > 2) it allows us avoid CI integration errors because no one compiled in
> > release mode before submitting
>
> I'm sure it's as obvious to you as it is to me that both of those would be
> solved in a SIC way by a new macro. Q_CHECKED_ASSERT or similar.
>
> It's not a good argument for the SIC.
It's a minor SIC and I still call it justified. Anyone who was using #ifndef
was making assumptions about Q_ASSERT's internals and how it is declared. We
should all agree that making assumptions is a bad idea.
With this change, there's no longer the need to make any assumptions.
And it saves us from ugly:
int x = someFunction();
Q_ASSERT(x);
Q_UNUSED(x);
As for adding a new macro... I don't want to replace every one of them in Qt.
$ git submodule --quiet foreach "git grep Q_ASSERT -- '*.cpp' '*.mm' '*.h' ||
true" | wc -l
9390
--
Thiago Macieira - thiago.macieira (AT) intel.com
Software Architect - Intel Open Source Technology Center
More information about the Development
mailing list