[Development] Upgrading the sources to C++11 keywords (Q_NULLPTR, etc.)
Matthew Woehlke
mwoehlke.floss at gmail.com
Thu Jul 23 17:49:35 CEST 2015
On 2015-07-23 08:23, Marc Mutz wrote:
> On Thursday 08 January 2015 23:33:34 Thiago Macieira wrote:
>> * Q_NULLPTR - strongly encouraged
>
> Ok, trying to summarize the discussion so we can move forward.
>
> There's a bug report (https://bugreports.qt.io/browse/QTBUG-45291) about Qt
> headers not compiling with -Wzero-as-null-pointer-constant, sometimes not even
> when locking the Qt headers away behind an -isystem. I understood the
> discussion in this thread as follows:
>
> - ok to use Q_NULLPTR in public headers (the bug report suggests that this
> should actually be enforced by headersclean).
The bug reporter would appreciate that, yes :-). Especially in macros
(e.g. Q_OBJECT¹) and default parameter values. (The reporter would also
appreciate https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43486 getting
fixed, but that doesn't seem likely to happen any time soon :-(. And no,
I'm not asking Qt to fix GCC bugs; just mentioning it because it is
pertinent.)
(¹ Pedantic: the original report indicates that the problem in Q_OBJECT
is indirect, via QT_TR_FUNCTIONS. IIRC in 4.8.x there are a lot more
such issues in Q_OBJECT, most of which have been fixed by now. Also,
QT_TR_FUNCTIONS may be fixed already in 5.5; I haven't checked yet.)
--
Matthew
More information about the Development
mailing list